symbol-iterator-x
v1.1.2
Published
The system Symbol.iterator (real or fake)
Downloads
505
Maintainers
Readme
symbol-iterator-x
The system Symbol.iterator (real or fake)
Possible values are.
- Symbol.iterator (real)
- '_es6-shim iterator_' (fake)
- '@@iterator' (fake)
Example
import $iterator$, {getSymbolIterator} from 'symbol-iterator-x';
const array = [];
typeof array[$iterator$] === 'function'; // true
getSymbolIterator(array) === $iterator$; // true
getSymbolIterator() === undefined; // true
getSymbolIterator(null) === undefined; // true
getSymbolIterator(1) === undefined; // true