https://github.com/goatslacker/es-symbol
A spec-compliant as much as it could be, small, and tested ES6 Symbol implementation.
https://github.com/goatslacker/es-symbol
es2015 es6 es6-polyfill javascript
Last synced: 2 months ago
JSON representation
A spec-compliant as much as it could be, small, and tested ES6 Symbol implementation.
- Host: GitHub
- URL: https://github.com/goatslacker/es-symbol
- Owner: goatslacker
- Created: 2015-02-04T02:33:26.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-05-07T23:47:44.000Z (about 10 years ago)
- Last Synced: 2025-02-28T05:54:14.453Z (3 months ago)
- Topics: es2015, es6, es6-polyfill, javascript
- Language: JavaScript
- Size: 195 KB
- Stars: 6
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# es-symbol
> A spec-compliant as much as it could be, small, and tested ES6 Symbol implementation.
[](http://badge.fury.io/js/es-symbol)
[](http://travis-ci.org/goatslacker/es-symbol)
[](https://coveralls.io/r/goatslacker/es-symbol)
[](https://david-dm.org/goatslacker/es-symbol)* No unnecessary dependencies
* Works in node + browser (IE8--Modern browsers)
* Uses native `Symbol` if possible otherwise exports a polyfill## Usage
```sh
npm install es-symbol
``````js
var Symbol = require('es-symbol')var sym = Symbol('foo')
var obj = {}
obj[sym] = 'hello'// The following are true
obj.foo === undefined
obj[sym] === 'hello'
```Disclaimer: This depends on ES5. If you need to support legacy browsers consider using an ES5 shim.
## More information
[Symbol Spec](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-symbol-constructor)
[Symbols in ECMAScript 6](http://www.2ality.com/2014/12/es6-symbols.html)
## License
[](http://josh.mit-license.org)