I have written this small function to get all keys and values of an object and store them into an array. The object might contain arrays as values...
Object {
You could just concat all keys and values. (It does not solve the type casting to number for keys.)
var object = { 0: [1, 2, 3, 4] }, result = Object.keys(object).reduce(function (r, k) { return r.concat(k, object[k]); }, []); console.log(result);