Travis build: 194
This commit is contained in:
24
README.md
24
README.md
@ -107,6 +107,7 @@ average(1, 2, 3);
|
||||
<summary>View contents</summary>
|
||||
|
||||
* [`all`](#all)
|
||||
* [`allEqual`](#allequal)
|
||||
* [`any`](#any)
|
||||
* [`arrayToCSV`](#arraytocsv)
|
||||
* [`bifurcate`](#bifurcate)
|
||||
@ -835,6 +836,29 @@ all([1, 2, 3]); // true
|
||||
<br>[⬆ Back to top](#table-of-contents)
|
||||
|
||||
|
||||
### allEqual
|
||||
|
||||
Check if all elements are equal
|
||||
|
||||
Use `Array.every()` to check if all the elements of the array are the same as the first one.
|
||||
|
||||
```js
|
||||
const allEqual = arr => arr.every(val => val === arr[0]);
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Examples</summary>
|
||||
|
||||
```js
|
||||
allEqual([1, 2, 3, 4, 5, 6]); // false
|
||||
allEqual([1, 1, 1, 1]); // true
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<br>[⬆ Back to top](#table-of-contents)
|
||||
|
||||
|
||||
### any
|
||||
|
||||
Returns `true` if the provided predicate function returns `true` for at least one element in a collection, `false` otherwise.
|
||||
|
||||
Reference in New Issue
Block a user