Symbol
'use strict'; let name1=Symbol('name'); let name2=Symbol('name'); console.log(name1===name2);//false console.log(Symbol.keyFor(name1));//underfined let name3=Symbol.for('name'); let name4=Symbol.for('name'); console.log(name3===name4);//true console.log(Symbol.keyFor(name3));//‘name’ let name=Symbol('name'); let obj= { age:22, [name]:'leo' }; //获取所有Symbol元素 console.log(Object.getOwnPropertySymbols(obj) ) ;