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