Polyfills
A polyfill is a code snippet (in terms of javascript web architecture) used for modern world functionalities on older browsers that do not implement it natively. They're essential because it teaches various deep-level concepts of javascript. Here, we are going to implement map, filter, reduce and promise.all polyfills.
User Stories:
- Implement
myMap()
method that can iterate over an array and returns a copy of the array with the function that the user provides.
- Implement
myFilter()
method that can iterate over an array and returns a new array based on a boolean that matches the user function passed.
- Implement
myReduce()
method that takes in an array and returns one single value at the end, based on the function that the user provides. It also takes into account an accumulator.
- Implement
myPromise.all()
method that takes in an array of promises
and resolves ONLY if all of the passed promises resolve.