240
世界上有2种人,一种懂二进制,另一种不懂二进制。

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

 

posted @ 2022-08-16 16:32  _Origin  阅读(51)  评论(0编辑  收藏  举报