repl.txt (1166B)
1 2 {{alias}}( collection, predicate[, thisArg ] ) 3 Tests whether all elements in a collection fail a test implemented by a 4 predicate function. 5 6 The predicate function is provided three arguments: 7 8 - `value`: collection value 9 - `index`: collection index 10 - `collection`: the input collection 11 12 The function immediately returns upon encountering a truthy return value. 13 14 If provided an empty collection, the function returns `true`. 15 16 Parameters 17 ---------- 18 collection: Array|TypedArray|Object 19 Input collection over which to iterate. If provided an object, the 20 object must be array-like (excluding strings and functions). 21 22 predicate: Function 23 The test function. 24 25 thisArg: any (optional) 26 Execution context. 27 28 Returns 29 ------- 30 bool: boolean 31 The function returns `true` if the predicate function returns a falsy 32 value for all elements; otherwise, the function returns `false`. 33 34 Examples 35 -------- 36 > function negative( v ) { return ( v < 0 ); }; 37 > var arr = [ 1, 2, 3, 4 ]; 38 > var bool = {{alias}}( arr, negative ) 39 true 40 41 See Also 42 -------- 43