Correcting teacher:PHPz
Correction status:qualified
Teacher's comments:
class Demo1 {
//公共成员
username = '测试';
//构造方法,实例初始化
constructor(name,email){
//自由属性
this.name = name;
this.email = email;
}
//共享 成员;原型成员
getInfo(){
return `${this.name} : (${this.email})`;
}
//静态成员
static status = 'enabled';
}
let [username, useremail] = ['测试中', '333@qq.com'];
console.log(username, useremail);
console.log('----------------------');
//更新
[username, useremail] = ['测试中中', '333@qq.com'];
console.log(username, useremail);
console.log('----------------------');
let {id, lesson, soure} = {id:1,lesson:'js',soure:88};
console.log(id, lesson, soure);
({id, lesson, soure} = {id:2,lesson:'php',soure:88});
console.log(id, lesson, soure);
let {id: itemid, num, price} = {id:3, num:10, price:1234};
console.log(itemid, num, price);