Methods
static
current() → {Object|Array.<Number>|Boolean}
Returns the current indices of the iterators
Returns
-
Object
current
-
Array.<Number>
[current.value]
-
Boolean
current.done
Example
import { array } from 'vectorious/core/array';
import { NDMultiIter } from 'vectorious/iterator';
const iter = new NDMultiIter(array([1, 2, 3]), array([4, 5, 6]));
iter.current(); // { value: [0, 0], done: false }
Source
static
done() → {Boolean}
Returns true if the iterator is done, false otherwise
Returns
-
Boolean
Example
import { array } from 'vectorious/core/array';
import { NDMultiIter } from 'vectorious/iterator';
const iter = new NDMultiIter(array([1, 2, 3]), array([4, 5, 6]));
iter.done(); // false
Source
static
next() → {Object|Array.<Number>|Boolean}
Steps to the next position in the iterator. Returns the current indices of the iterators, or undefined if done.
Returns
-
Object
current
-
Array.<Number>
[current.value]
-
Boolean
current.done
Example
import { array } from 'vectorious/core/array';
import { NDMultiIter } from 'vectorious/iterator';
const iter = new NDMultiIter(array([1, 2, 3]), array([4, 5, 6]));
iter.next(); // { value: [0, 0], done: false }
iter.next(); // { value: [1, 1], done: false }
iter.next(); // { value: [2, 2], done: false },
iter.next(); // { value: undefined, done: true },