repl.txt (1882B)
1 2 {{alias}}( iter0, iter1, fcn[, options] ) 3 Returns an iterator which invokes a binary function accepting numeric 4 arguments for each iterated value. 5 6 When invoked, the input function is provided two arguments: 7 8 - x: iterated value from first input iterator 9 - y: iterated value from second input iterator 10 11 The length of the returned iterator is equal to the length of the shortest 12 provided iterator. In other words, the returned iterator ends once *one* of 13 the provided iterators ends. 14 15 If provided a numeric value as an iterator argument, the value is broadcast 16 as an infinite iterator which always returns the provided value. 17 18 If an environment supports Symbol.iterator and provided iterators are 19 iterable, the returned iterator is iterable. 20 21 Parameters 22 ---------- 23 iter0: Object 24 First input iterator. 25 26 iter1: Object 27 Second input iterator. 28 29 fcn: Function 30 Function to invoke for each iterated value. 31 32 options: Object (optional) 33 Options. 34 35 options.invalid: any (optional) 36 Return value when an input iterator yields a non-numeric value. Default: 37 NaN. 38 39 Returns 40 ------- 41 iterator: Object 42 Iterator. 43 44 iterator.next(): Function 45 Returns an iterator protocol-compliant object containing the next 46 iterated value (if one exists) and a boolean flag indicating whether the 47 iterator is finished. 48 49 iterator.return( [value] ): Function 50 Finishes an iterator and returns a provided value. 51 52 Examples 53 -------- 54 > var it0 = {{alias:@stdlib/random/iter/randu}}(); 55 > var it1 = {{alias:@stdlib/random/iter/randu}}(); 56 > var it = {{alias}}( it0, it1, {{alias:@stdlib/math/base/special/copysign}} ); 57 > var r = it.next().value 58 <number> 59 > r = it.next().value 60 <number> 61 62 See Also 63 -------- 64