File tree 1 file changed +9
-9
lines changed
1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -400,26 +400,26 @@ Array.fromAsync([], 1);
400
400
401
401
### Relationship with iterator-helpers
402
402
The [iterator-helpers][] proposal has toArray, which works with both sync and
403
- async iterables.
403
+ async iterables. The following pairs of lines are equivalent:
404
404
405
405
[iterator-helpers]: https://github.com/tc39/proposal-iterator-helpers
406
406
407
407
` ` ` js
408
408
// Array.from
409
409
410
- Array .from (input )
411
- Iterator (input ).toArray ()
410
+ Array .from (iterable )
411
+ Iterator (iterable ).toArray ()
412
412
413
- Array .from (input , mapfn)
414
- Iterator (input ).map (mapfn).toArray ()
413
+ Array .from (iterable , mapfn)
414
+ Iterator (iterable ).map (mapfn).toArray ()
415
415
416
416
// Array.asyncFrom
417
417
418
- Array .fromAsync (input )
419
- AsyncIterator (input ).toArray ()
418
+ Array .fromAsync (asyncIterable )
419
+ AsyncIterator (asyncIterable ).toArray ()
420
420
421
- Array .fromAsync (input , mapfn)
422
- AsyncIterator (input ).map (mapfn).toArray ()
421
+ Array .fromAsync (asyncIterable , mapfn)
422
+ AsyncIterator (asyncIterable ).map (mapfn).toArray ()
423
423
` ` `
424
424
425
425
toArray overlaps with both Array.from and Array.fromAsync. This is okay. They
You can’t perform that action at this time.
0 commit comments