JS-Symbol(javascript的第七种数据类型)
introduce
在ES5中对象的属性名都是字符串,这容易造成属性名的冲突。引入Symbol类型来解决命名冲突的问题。
Symbol的值通过Symbol函数来生成,也就是说,对象的属性名现在可以有两种类型,1、原来就有的字符串 2、Symbol类型
feature
1、the value about Symbol is Unique,is used to be resolve the problem of naming conflicts
2、the value about Symbol is not eachother Calculate with other data
3、Object properties defined cannot be traversed using methods
Know the Symbol
Symbol funcation can accept a String as argument