repl.txt (968B)
1 2 {{alias}}( ...f ) 3 Function composition. 4 5 Returns a composite function. Starting from the right, the composite 6 function evaluates each function and passes the result as an argument 7 to the next function. The result of the leftmost function is the result 8 of the whole. 9 10 Notes: 11 12 - Only the rightmost function is explicitly permitted to accept multiple 13 arguments. All other functions are evaluated as unary functions. 14 - The function will throw if provided fewer than two input arguments. 15 16 Parameters 17 ---------- 18 f: ...Function 19 Functions to compose. 20 21 Returns 22 ------- 23 out: Function 24 Composite function. 25 26 Examples 27 -------- 28 > function a( x ) { 29 ... return 2 * x; 30 ... } 31 > function b( x ) { 32 ... return x + 3; 33 ... } 34 > function c( x ) { 35 ... return x / 5; 36 ... } 37 > var f = {{alias}}( c, b, a ); 38 > var z = f( 6 ) 39 3 40 41 See Also 42 -------- 43