I wish to create a new array that contains objects from another Object
This was my try:
var obj = {
a:{},
b:{}
}
var arr = new Array().concat(obj,[]);
Sadly, this is returning an array like this:
Array[1]
0: Object
a: Object
b: Object
The desired array, however, should look like this:
Array[2]
0: Object
a: Object
1: Object
b: Object
How could i achieve that in the shortest possible way, without having to loop the object?
var arr = [obj.a, obj.b];?[{a: obj.a}, {b: obj.b}].