How can I get the full object in Node.js’s console.log(), rather than ‘[Object]’?

I have this object:

const myObject = {
   "a":"a",
   "b":{
      "c":"c",
      "d":{
         "e":"e",
         "f":{
            "g":"g",
            "h":{
               "i":"i"
            }
         }
      }
   }
};

But when I try to show it using console.log(myObject), I receive this output:

{ a: 'a', b: { c: 'c', d: { e: 'e', f: [Object] } } }

How can I get the full object, including the content of property f?

1
18

Leave a Comment