Deena P Deena P - 1 year ago 42
Javascript Question

convert an array of objects to a dataset that can be feed into a jquery datatable

I have an array like below one,

["abc", "xyz", "mno"]

now I want to convert it into an another array which has wrapped each element with a square bracket, like below one

["abc"], ["xyz"], ["mno"]

so I can use this dataset to create single column datatable.


var a = ["abc", "xyz", "mno"];
var aa = [];
for(i in a){