Imagine I have
const obj = {
arr_a: [9, 3, 2],
arr_b: [1, 5, 0],
arr_c: [7, 18]
}
what's the best way to convert this object to a simple array like:
[9, 3, 2, 1, 5, 0, 7, 18]
I tried this:
[].concat(obj.arr_a, obj.arr_b, obj.arr_c)
But I wonder if there's something in lodash or underscore to do it. Something like:
_.flatAsArray(obj);
or:
obj.toFlatArray();