repl.txt (1700B)
1 2 {{alias}}( N, src, stride, offset[, mapFcn[, thisArg]] ) 3 Returns an iterator which iterates over elements of an array-like object 4 according to specified stride parameters. 5 6 When invoked, an input function is provided four arguments: 7 8 - value: iterated value 9 - index: iterated value index 10 - n: iteration count (zero-based) 11 - src: source array-like object 12 13 If an environment supports Symbol.iterator, the returned iterator is 14 iterable. 15 16 If an environment supports Symbol.iterator, the function explicitly does not 17 not invoke an array's `@@iterator` method, regardless of whether this method 18 is defined. To convert an array to an implementation defined iterator, 19 invoke this method directly. 20 21 Parameters 22 ---------- 23 N: integer 24 Number of values to iterate. 25 26 src: ArrayLikeObject 27 Array-like object from which to create the iterator. 28 29 stride: integer 30 Stride length. 31 32 offset: integer 33 Starting index. 34 35 mapFcn: Function (optional) 36 Function to invoke for each iterated value. 37 38 thisArg: any (optional) 39 Execution context. 40 41 Returns 42 ------- 43 iterator: Object 44 Iterator. 45 46 iterator.next(): Function 47 Returns an iterator protocol-compliant object containing the next 48 iterated value (if one exists) and a boolean flag indicating whether the 49 iterator is finished. 50 51 iterator.return( [value] ): Function 52 Finishes an iterator and returns a provided value. 53 54 Examples 55 -------- 56 > var it = {{alias}}( 2, [ 1, 2, 3, 4 ], -2, 3 ); 57 > var v = it.next().value 58 4 59 > v = it.next().value 60 2 61 62 See Also 63 -------- 64