classBar {constructor(){this.name ='bar-name'this.age =18 }info() {return`name is ${this.name}, age is ${this.age}` }}constb=new barb.name // bar-nameb.info() // "name is bar-name, age is 18"Bar.prototype.info() // "name is bar-name, age is 18"b.constructor.name // Barb2 = {...b}b2.name // 'bar-name'b2.info() //errorb2.constructor// Object