Class: ArrayIterator

asynciterator~ArrayIterator(items)

An iterator that emits the items of a given array.

Constructor

new ArrayIterator(items)

Creates a new ArrayIterator.

Parameters:
Name Type Attributes Default Description
items Array

The items that will be emitted.

options.autoStart boolean <optional>
true

Whether buffering starts directly after construction

options.preserve boolean <optional>
true

If false, the passed array can be safely modified

Extends

  • module:asynciterator.AsyncIterator

Methods

toArray(optionsopt)

Consume all remaining items of the iterator into an array that will be returned asynchronously.

Parameters:
Name Type Attributes Description
options object <optional>

Settings for array creation

Properties
Name Type Attributes Description
limit integer <optional>

The maximum number of items to place in the array.