unboundedpress/node_modules/symbol
2019-07-23 04:28:47 +00:00
..
index.js initial commit 2019-07-23 04:28:47 +00:00
LICENSE initial commit 2019-07-23 04:28:47 +00:00
package.json initial commit 2019-07-23 04:28:47 +00:00
README.md initial commit 2019-07-23 04:28:47 +00:00

Symbols

NPM version

ES6 Symbols, in your ES5.

If Symbol is already defined, it will be used. Otherwise, this implements as much of the Symbol spec as is possible with plain JavaScript.

Usage

var Symbol = require('symbol');
var key = Symbol();

var obj = {};
obj[key] = 'foo';
console.log(obj[key]); // 'foo'
console.log(Object.keys(obj)); // []