Managing a JS array with 66 examples can be overwhelming, but I have narrowed it down to just 4 for simplicity:
[["A","Example1"],["A","Example2"],["B","Example3"],["B","Example4"]]
I am now faced with the challenge of converting this array into an object that will work seamlessly with a multi select drop down menu:
var opt = [{
label: 'A', children:[
{"label":"Example1","value":"Example1","selected":"TRUE"},
{"label":"Example2","value":"Example2","selected":"TRUE"}
]
},
{
label: 'B', children:[
{"label":"Example3","value":"Example3","selected":"TRUE"},
{"label":"Example4","value":"Example4","selected":"TRUE"}
]
}
]
Does anyone know of a more efficient way to accomplish this task?