-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Closed
Labels
consoleIssues and PRs related to the console subsystem.Issues and PRs related to the console subsystem.questionIssues that look for answers.Issues that look for answers.utilIssues and PRs related to the built-in util module.Issues and PRs related to the built-in util module.
Description
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] } ] }
Metadata
Metadata
Assignees
Labels
consoleIssues and PRs related to the console subsystem.Issues and PRs related to the console subsystem.questionIssues that look for answers.Issues that look for answers.utilIssues and PRs related to the built-in util module.Issues and PRs related to the built-in util module.