var a = [{c:1}]
var b = a.slice()
a[0].c++
console.log(b);
const stu1 = Symbol('张三')
const stu2 = Symbol('张三')
const grade = {
[stu1]:{address: 'xxx' , tel: '1111'},
[stu2]:{address:'aaa',tel:'2222'}
}
console.log(grade[stu1])
console.log(grade[stu2])
console.log(grade)
const sym = Symbol('imooc')
class User {
constructor(name) {
this.name = name
}
getName(){
return this.name + this[sym]
}
}
const user = new User('name')
console.log(user.name)
//for in 只能去到不是symbol 属性
for(let key in user){
console.log(key)
}
console