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
738 B
27 lines
738 B
5 years ago
|
## Mapper
|
||
|
|
||
|
### Instructions
|
||
|
|
||
|
- Create a `map` function that takes an array as first argument, a function as second,
|
||
|
and that works like the method .map
|
||
|
|
||
|
- Create a `flatMap` function that takes an array as first argument, a function as second,
|
||
|
and that works like the method .flatMap
|
||
|
|
||
|
|
||
|
### Notions
|
||
|
|
||
5 years ago
|
- [devdocs.io/javascript/global_objects/array/map](https://devdocs.io/javascript/global_objects/array/map)
|
||
|
- [devdocs.io/javascript/global_objects/array/flatmap](https://devdocs.io/javascript/global_objects/array/flatmap)
|
||
5 years ago
|
|
||
|
|
||
|
### Code provided
|
||
5 years ago
|
|
||
|
> all code provided will be added to your solution and doesn't need to be submited.
|
||
|
|
||
5 years ago
|
```js
|
||
|
Array.prototype.map = undefined
|
||
|
Array.prototype.flatMap = undefined
|
||
|
Array.prototype.flat = undefined
|
||
|
```
|