es-symbol
A spec-compliant as much as it could be, small, and tested ES6 Symbol implementation.
- No unnecessary dependencies
- Works in node + browser (IE8--Modern browsers)
- Uses native
Symbol
if possible otherwise exports a polyfill
Usage
npm install es-symbol
var Symbol = var sym = Symbol'foo' var obj = {}objsym = 'hello' // The following are trueobjfoo === undefinedobjsym === 'hello'
Disclaimer: This depends on ES5. If you need to support legacy browsers consider using an ES5 shim.