repl.txt (1057B)
1 2 {{alias}}( predicate ) 3 Returns a function which tests if every element in an array passes a test 4 condition. 5 6 The predicate function should accept a single argument: an array element. If 7 the array element satisfies a test condition, the function should return 8 `true`; otherwise, the function should return `false`. 9 10 Given an input array, the returned function returns `true` if all elements 11 pass the test and `false` otherwise. 12 13 The returned function returns `false` if provided an empty array. 14 15 The returned function returns `false` is not provided an array. 16 17 Parameters 18 ---------- 19 predicate: Function 20 Function to apply. 21 22 Returns 23 ------- 24 fcn: Function 25 Function which tests if every element in an array passes a test 26 condition. 27 28 Examples 29 -------- 30 > var fcn = {{alias}}( {{alias:@stdlib/assert/is-odd}} ); 31 > var arr = [ 1, 3, 5, 7 ]; 32 > var bool = fcn( arr ) 33 true 34 > arr = [ 3, 5, 8 ]; 35 > bool = fcn( arr ) 36 false 37 38 See Also 39 -------- 40