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.
|
|
|
## Filter
|
|
|
|
|
|
|
|
### Instructions
|
|
|
|
|
|
|
|
|
|
|
|
Create the following functions, which each take an array as the first argument, and a function as the second argument.
|
|
|
|
|
|
|
|
- `filter`: that works like the `[].filter` method.
|
|
|
|
|
|
|
|
- `reject`: that works like the `reject` function from lodash.
|
|
|
|
|
|
|
|
- `partition`: that works like the `partition` function from lodash.
|
|
|
|
|
|
|
|
### Code provided
|
|
|
|
|
|
|
|
> The provided code will be added to your solution, and does not need to be submitted.
|
|
|
|
|
|
|
|
```js
|
|
|
|
Array.prototype.filter = undefined
|
|
|
|
```
|
|
|
|
|
|
|
|
### Notions
|
|
|
|
|
|
|
|
- [devdocs.io/javascript/global_objects/array/filter](https://devdocs.io/javascript/global_objects/array/filter)
|
|
|
|
- [lodash.com/docs/4.17.15#reject](https://lodash.com/docs/4.17.15#reject)
|
|
|
|
- [lodash.com/docs/4.17.15#partition](https://lodash.com/docs/4.17.15#partition)
|