repl.txt (948B)
1 2 {{alias}}( iterator ) 3 Returns an iterator which iteratively computes a cumulative range. 4 5 If an environment supports Symbol.iterator, the returned iterator is 6 iterable. 7 8 Parameters 9 ---------- 10 iterator: Object 11 Input iterator. 12 13 Returns 14 ------- 15 iterator: Object 16 Iterator. 17 18 iterator.next(): Function 19 Returns an iterator protocol-compliant object containing the next 20 iterated value (if one exists) and a boolean flag indicating whether the 21 iterator is finished. 22 23 iterator.return( [value] ): Function 24 Finishes an iterator and returns a provided value. 25 26 Examples 27 -------- 28 > var arr = {{alias:@stdlib/array/to-iterator}}( [ 2.0, -5.0, 3.0, 5.0 ] ); 29 > var it = {{alias}}( arr ); 30 > var r = it.next().value 31 0.0 32 > r = it.next().value 33 7.0 34 > r = it.next().value 35 8.0 36 > r = it.next().value 37 10.0 38 39 See Also 40 -------- 41