0

Converting a JS object to an array using jQuery

var myObj = {
    1: [1, 2, 3],
    2: [4, 5, 6]
};

var array = $.map(myObj, function(value, index) {
    return [value];
});


console.log(array); // [[1, 2, 3], [4, 5, 6]]
<h1>
  Converting a JS object to an array using jQuery
</h1>
RUN
add comment
Suggest a different solution or add another example