JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 190952
  • Score
    100M100P100Q146342F
  • License MPLv2.0

ES6 Symbols in your ES5.

Package Exports

  • symbol

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (symbol) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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)); // []