Converts iterable to array.
npm install @extra-array/fromConverts iterable to array.
:package:
:smiley_cat:
:running:
:vhs:
:moon:
:scroll:
:newspaper:
:blue_book:
> Alternatives: [from], [from$], [fromRange], [fromApply].
> This is part of package [extra-array].
[extra-array]: https://www.npmjs.com/package/extra-array
``javascript`
array.from(x);
// x: an iterable
`javascript
const array = require("extra-array");
var x = [1, 2].values();
array.from(x);
// [ 1, 2 ]
``
- Symbol.iterator: MDN web docs
- Array.from: sugarjs
[from]: https://github.com/nodef/extra-array/wiki/from
[fromRange]: https://github.com/nodef/extra-array/wiki/fromRange
[fromApply]: https://github.com/nodef/extra-array/wiki/fromApply
[from$]: https://github.com/nodef/extra-array/wiki/from$