Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Задача 2:
- /*
- Fully implement the function *createFilter* so it
- creates a closure over another function and returns
- a function that filters an array using the passed
- function in *createFilter*
- */
- const createFilter = (/* needs to be implemented */) => {
- /* needs to be implemented */
- }
- const nums = [2, 5, 19, 27, 30, 38, 40, 45, 99];
- const filterUnder30 = createFilter(x => x >= 30);
- const notUnder30 = filterUnder30(nums);
- console.log(notUnder30); // should be [30, 38, 40, 45, 99]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement