I have this code. As you can see, the stringified version of the obejct, and the representation used by console.log are different. Is it a bug, or a limitation in the console.log?
function parse() {
var cont = [];
var obj = {};
cont.push(obj);
var arr = [];
obj['sw'] = arr;
arr.push(1);
return cont;
}
var obj = {};
var a = 'ee';
obj[a] = parse();
console.log(JSON.stringify(obj));
console.log(obj);
Output:
{"ee":[{"sw":[1]}]}
{ ee: [ { sw: [Object] } ] }