How to create a Javascript object with index and values with variables?

I have a problem in my javascript code, i need to create an object with variables and those variables being objects too. Explanation: I need this in my javascript code (similar to a Json structure): var myObj = { variableOne: { variableOneA: ‘someValue’, variableOneB: ‘someValue’ } variableTwo: { variableTwoA: ‘someValue’, variableTwoB: ‘someValue’ } variableThree: {…

Filter array in javascript

I have an array which including all of the times as below : [“14:00-14:30” , “14:30-15:00”, “15:00-15:30”] as you can see this time slots, so basically, its from : 14:00 to 15:30 output will be : [“14:00-15:30”] But if i have : [“14:00-14:30”, “14:30-15:00”, “15:30-16:00”] in this case, the output would be : [“14:00-15:00”, “15:30-16:00”]…

javascript array.Join continious srings values into new array

i have this array = [“john”, “mike”, “george”, 55, “hello”, 344, “goodmorning”] and i want to take this:[“johnmikegeorge”,55,”hello”,344,”goodmorning”].I want where there are continuous strings to unite them into one. var s = “” var new_data = [] var pin = [“john”, “mike”, “george”, 55, “hello”, 344, “goodmorning”] for (let i = 0; i < pin.length;…