let a=new String
let b=new Number
let c=new Boolean
let d=new Array
let e=new Object
let f=Symbol()
console.log(typeof f); //Symbol
let js=Symbol('技术')
console.log(js);
console.log(js.toString());
一个是Symbol,一个是字符串
let js = Symbol()
let obj = {
[js]: '技术'
}
console.log(obj[js]);
obj[js] = 'web'
console.log(obj[js]);
let obj = {
name: 'sun',
skill: 'web',
}
let age=Symbol()
obj[age] = 18
console.log(obj);
for (const item in obj) {
console.log(obj[item]);
}
console.log(obj[age]);