repl.txt (732B)
1 2 {{alias}}( collection ) 3 Tests whether at least one element in a collection is truthy. 4 5 The function immediately returns upon encountering a truthy value. 6 7 If provided an empty collection, the function returns `false`. 8 9 Parameters 10 ---------- 11 collection: Array|TypedArray|Object 12 Input collection over which to iterate. If provided an object, the 13 object must be array-like (excluding strings and functions). 14 15 Returns 16 ------- 17 bool: boolean 18 The function returns `true` if an element is truthy; otherwise, the 19 function returns `false`. 20 21 Examples 22 -------- 23 > var arr = [ 0, 0, 0, 0, 1 ]; 24 > var bool = {{alias}}( arr ) 25 true 26 27 See Also 28 -------- 29