filter-arraylike-iterable
filter-arraylike-iterable
exports a class that, given an array-like iterable, builds iterables that provide filter method.
Install
$ npm install filter-arraylike-iterable --save
Usage
const FilterArrayLikeIterable =const iterable = 4 2 7 8 4 3 1 // (4 7 4 1)// (4 7 8 7)// (7 1)// converting to array:...iterable // [7, 1]// traversing values:for const val of iterable// ...// creating an iterator that traverses the valueslet iterator = iterableSymboliteratoriteratornext // {value: 7, done: false}iteratornext // {value: 1, done: false}iteratornext // {value: undefined, done: true}// the same with stringconst string = 'abcdef'string // ('a' 'b' 'c' 'd' 'e' 'f')// ('a' 'b' 'd' 'f')// the same with typed arrayconst typedArray = 128 0 0 1naturals // (128 0 0 1)// (128 1)
Support
- Node.js >=6
- ES2015 transpilers
License
MIT