repl.txt (828B)
1 2 {{alias}}( collection, n ) 3 Tests whether at least `n` elements in a collection are truthy. 4 5 The function immediately returns upon finding `n` truthy elements. 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 n: number 16 Minimum number of truthy elements. 17 18 Returns 19 ------- 20 bool: boolean 21 The function returns `true` if a collection contains at least `n` truthy 22 elements; otherwise, the function returns `false`. 23 24 Examples 25 -------- 26 > var arr = [ 0, 0, 1, 2, 3 ]; 27 > var bool = {{alias}}( arr, 3 ) 28 true 29 30 See Also 31 -------- 32