summaryrefslogtreecommitdiff
path: root/school/node_modules/@arr/every/readme.md
blob: 31cad87773ca74b98bff2a323c6268c2a98aa6b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# @arr/every

> A tiny, faster alternative to native `Array.prototype.every`

:warning: Unlike native, `@arr/every` does _not_ support the optional `thisArg` parameter!

## Install

```
$ npm install --save @arr/every
```

## Usage

```js
import every from '@arr/every';

const isBigEnough = val => val >= 10;

every([12, 5, 8, 130, 44], isBigEnough);
//=> false
every([12, 54, 18, 130, 44], isBigEnough);
//=> true
```

## API

### every(arr, callback)

#### arr
Type: `Array`<br>
The array to iterate upon.

#### callback(value[, index, array])
Type: `Function`<br>
Function to test for each element, taking three arguments:

* **value** (required) -- The current element being processed in the array.
* **index** (optional) -- The index of the current element being processed in the array.
* **array** (optional) -- The array `every` was called upon.


## License

MIT © [Luke Edwards](http://lukeed.com)