Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const partialApply = (fn, ...fixedArgs) => {
- return (...remainingArgs) => fn(...fixedArgs.concat(...remainingArgs));
- };
- const add = (a, b) => a + b;
- const add10 = partialApply(add, 10);
- console.log(add10(5)) // 15
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement