Q:

Write a JavaScript program to create a function that invokes fn with partials appended to the arguments it receives

0

Write a JavaScript program to create a function that invokes fn with partials appended to the arguments it receives.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

const partialRight = (fn, ...partials) => (...args) => fn(...args, ...partials);
const greet = (greeting, name) => greeting + ' ' + name + '!';
const greetJohn = partialRight(greet, 'John');
console.log(greetJohn('Hello'));

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now