Hi all,I'm taking a look at classes and found this example [source]:class Hero { constructor(name, level) { this.name = name this.level = level } // Adding a method to the constructor greet() { return `${this.name} says hello.` } } const hero1 = new Hero('Varg', 1) When I output the object in Chrome I can see all Object properties:console.log(hero1); Hero {name: "Varg", level: 1} level: 1 name: "Varg" __proto__: Object (I have to click on the arrow on the left side)When I output the object in Node I see only the 2 Object properties (name, level):console.log(hero1); Hero {name: "Varg", level: 1} Same with e.g. util:const util = require('util') console.log(util.inspect(hero1, { showHidden: false, depth: null })) console.log(util.inspect(hero1, false, null, true /* enable colors */ )) Is there a way to see the whole Object in Node?
Submitted May 01, 2020 at 01:59PM by reditoro
No comments:
Post a Comment