In the console I have an array that looks like this:
Array[3]
0: Object
1: Object
2: Object
columns: Array[2]
length: 3
__proto__: Array[0]
The last item hasn't an index, but the name columns
.
How can I reproduce something similar? I tried:
var columns = ["age", "population"];
var myObj = [
{age: "<5", population: 2704659},
{age: "5-13", population: 4499890},
{age: "14-17", population: 2159981},
columns
];
console.log(myObj);
But it gives me this:
// Console
Array[4]
0: Object
1: Object
2: Object
3: Array[2]
length: 4
__proto__: Array[0]