I have the below code
var temp = [{ "a": "value", "b": "value" }, { "a": "value", "b": "value" }];
> console.log(temp) prints
> [Object,Object]
If I pull the same from database/api as below
var items = [];
data.forEach(function (item) {
items.push({ "a": item.a , "b": item.b } );
})
> console.log(items) returns
> []
However if I expand the array, it has the same items.
How to push the elements so that the console.log
prints the same as if in the first case.