Created
December 21, 2022 23:58
-
-
Save simonplend/8c4fe3c813d0eee01b94c136a94f8da3 to your computer and use it in GitHub Desktop.
Example showing how to log a large, deep object with infinite depth in Node.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This could be any object, perhaps the | |
* response from a request to an API. | |
*/ | |
const deepObject = [ | |
{imGoing:{deeperUnderground:{theresToo:{muchPanic:{inThis:{town:["I'm going deeper underground","There's too much panic in this town"]}}}}}}, | |
{wellI:{gotToGo:{deeper:{gotToGo:{muchDeeper:true,theyGonna:{wreckItDown:true,theyGonna:["bring","it","down"]}}}}},rating:100} | |
]; | |
// @see https://nodejs.org/api/console.html#consoledirobj-options | |
console.dir(deepObject, { depth: null }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment