class B {
constructor (){
console.log('boonook');
}
}
let b = new B();
b.constructor === B.prototype.constructor // true//// 等同于
//装饰器
mounted(){
function testable(target) {
target.isTestable = true;
}
@testable
class Bar {
doStuff() {
return 'stuff'
}
deStuffConsole(){
console.log('boonook')
}
}
const b = new Bar();
console.log('这是一个javaceript的类CLASS',b.doStuff());
b.deStuffConsole();
console.log('这是一个装饰器',b.isTestable);
}