摘要:
class A { constructor(name,age ) { 把constructor整体换成: this.name = name; > static name = 'qwe'; this.age = age >static age = 12; } 后得到 say(){ console.lo 阅读全文
摘要:
class A { constructor(name,age) { this.name = name ; this.age = age; } say(){ console.log(this) //指向实例对象 console.log(`I am ${this.name}`) } static sss 阅读全文
摘要:
<body> <div id="box"> </body> <script type="text/javascript"> class A { constructor() { this.box = document.getElementById("box"); //获取父节点 this.img = 阅读全文