1.0.0 • Published 9 years ago
iterator-to-array v1.0.0
iterator-to-array
Stupid iterator -> array function until io.js supports Array.from or the polyfill supports the iterator. Or rest parameters or generator comprehensions are supported. Hate this.
API
let arr = toArray(iterable)
Example:
const toArray = require('iterator-to-array')
const map = new Map()
map.set(1, 100)
map.set(2, 200)
assert.deepEqual([1, 2], toArray(map.keys()))
1.0.0
9 years ago