issymbol
Version:
Test if something is a Symbol. Works with either native or polyfill Symbols.
35 lines (23 loc) • 700 B
Markdown
> `issymbol` tests if something is a Symbol. Works with either native Symbol or polyfill Symbol.
```
npm install --save issymbol
```
```js
const issymbol = require('issymbol');
// works with any native Symbol implementation
issymbol(Symbol());
// → true
// also works with your favourite polyfill
const core = require('core-js/library');
issymbol(core.Symbol());
// → true
// returns false any input that is not a Symbol
issymbol('not a symbol');
// → false
```
Code for `issymbol` originated from https://github.com/medikoo/es6-symbol/.
MIT