Skip to content

Instantly share code, notes, and snippets.

@joanna-liana
Created April 21, 2023 17:35
Show Gist options
  • Save joanna-liana/3067ef45f0904f03cc621786bbc31e9c to your computer and use it in GitHub Desktop.
Save joanna-liana/3067ef45f0904f03cc621786bbc31e9c to your computer and use it in GitHub Desktop.
Logging a deeply nested object without JSON.stringify
const nested = { a: { b: { c: { d: 1 } } } };
// { a: { b: { c: [Object] } } }
console.log(nested);
// {
// a: { b: { c: { d: 1 } } }
// }
console.log(
util.inspect(nested, { depth: null, colors: true })
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment