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