Add any, anyBy, all, allBy, none, noneBy
This commit is contained in:
13
snippets/any.md
Normal file
13
snippets/any.md
Normal file
@ -0,0 +1,13 @@
|
||||
### any
|
||||
|
||||
Returns `true` if at least one element in a collection is truthy, `false` otherwise.
|
||||
|
||||
Use `Array.some(Boolean)` to test if any elements in the collection are truthy.
|
||||
|
||||
```js
|
||||
const any = arr => arr.some(Boolean);
|
||||
```
|
||||
|
||||
```js
|
||||
any([0,0,1,0]); // true
|
||||
```
|
||||
Reference in New Issue
Block a user