xml
<script>
let s=Symbol()
console.log(typeof s);
let s1=Symbol("贾维斯")
//description可以获取symbol描述
console.log(s1.description);
//读取Symbol值Object.getOwnPropertySymbols
let info3Symbol=Symbol("job")
let info3={
name:"贾维斯",
age:20,
[info3Symbol]:"星期五"
}
for(let key in info3){
console.log(key);
}
console.log(Object.getOwnPropertySymbols(info3));
//需要创建重复的Symbol值,需要使用Symbol.for
let itsybol=Symbol.for("贾维斯")
let itsybol1=Symbol.for("贾维斯")
console.log(itsybol===itsybol1);
</script>