Let\'s say I have this class.
class Attribute { constructor(name) { this.name = name; } }
And I create an instance and log it to the c
class Attribute { constructor(name) { this.name = name; } toString(){//simply set the to String method? return "{Attribute} "+this.name; } }
As console.log does not call to String you either do:
const test = new Attribute('Large'); console.log(test+"");
or you create your own logging function