Symbol

Symbol

  The Symbol() function returns a value of type symbol. it does not support the syntax "new Symbol()".  

  Every symbol value returned from Symbol() is unique. A symbol value may be used as an identifier for object properties; this is the data type's only purpose. 

  The data type symbol is a primitive data type.

  

var sym1 = Symbol();
var sym2 = Symbol('foo');
var sym3 = Symbol('foo');

  The above code creates three new symbols.

  The following syntax with the new operator will throw a TypeError:

var sym = new Symbol(); // TypeError

链接:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol

原文地址:https://www.cnblogs.com/tekkaman/p/6622072.html