I'm trying to convert this object into array using jQuery
[["20"],["30"],["45"],["54"],["33"],["15"],["54"],["41"]]
I trying to get an array output like this:
[20,30,45,54,33,15,54,41]
How?
I'm trying to convert this object into array using jQuery
[["20"],["30"],["45"],["54"],["33"],["15"],["54"],["41"]]
I trying to get an array output like this:
[20,30,45,54,33,15,54,41]
How?
Just use map() method to change each array of one string value element into a coresponding number :
var input = [["20"],["30"],["45"],["54"],["33"],["15"],["54"],["41"]];
var result = input.map(x => Number(x[0]));
console.log(result);