What I have is something like this:
arr = {
a: [array],
b: [array],
c: [array]
}
... and so on But it is an object. How do I turn it into this:
arr = [[array],[array],[array]]
... and so on
What I have is something like this:
arr = {
a: [array],
b: [array],
c: [array]
}
... and so on But it is an object. How do I turn it into this:
arr = [[array],[array],[array]]
... and so on
Your question seems a little vague. However, If you are dealing with an Object you can use Object.values() to get an array of values back.
var obj = {'a': [1,2,3], 'b': [4,5,6], 'c': [6,7,8,9]};
var arr = Object.values(obj)
console.log(arr);
If you are dealing with a Map you can use Array from.
var arr = [
['a', [1, 2, 3]],
['b', [4, 5, 6]],
['c', [6, 7, 8, 9]]
];
arr = Array.from(arr, x => x[1]);
console.log(arr);