Travis build: 194

This commit is contained in:
30secondsofcode
2018-08-06 08:43:07 +00:00
parent c0048c9140
commit 64951eb3e8
12 changed files with 38 additions and 11 deletions

View File

@ -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.