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