mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
782 B
27 lines
782 B
5 years ago
|
## Quantifiers
|
||
|
|
||
|
### Instructions
|
||
|
|
||
|
Create three functions that receive an array and a function each:
|
||
|
|
||
|
- `every` that returns true if every element of the array respects the
|
||
|
condition of the received function and false otherwise.
|
||
|
- `some` that returns true if at least one element of the array respects the
|
||
|
condition of the received function and false otherwise.
|
||
|
- `none` that returns true if none of the elements of the array respects the
|
||
|
condition of the received function and false otherwise.
|
||
|
|
||
|
The use of `[].every` and `[].some` is forbidden for this exercise.
|
||
|
|
||
|
|
||
|
### Notions
|
||
|
|
||
|
- https://devdocs.io/javascript/global_objects/array/some
|
||
|
- https://devdocs.io/javascript/global_objects/array/every
|
||
|
|
||
|
|
||
|
### Code provided
|
||
|
```js
|
||
|
Array.prototype.some = Array.prototype.every = undefined
|
||
|
```
|