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