My application creates a JavaScript object, like the following:
myObj= {1:[Array-Data], 2:[Array-Data]}
But I need this object as an array.
If you know the maximum index in you object you can do the following:
var myObj = { 1: ['c', 'd'], 2: ['a', 'b'] }, myArr; myObj.length = 3; //max index + 1 myArr = Array.prototype.slice.apply(myObj); console.log(myArr); //[undefined, ['c', 'd'], ['a', 'b']]