Closures & Functions
Partial Application
mediumJS SpecificJS / TS3 tests
Problem Statement
Implement `partial(fn, ...presetArgs)`, which creates a function that invokes `fn` with `presetArgs` prepended to the arguments it receives.
Examples
Example 1:
const greet = (greeting, name) => `${greeting}, ${name}!`;
const sayHello = partial(greet, 'Hello');
sayHello('Alice'); // 'Hello, Alice!'JavaScript & TypeScript starter code included
Run this as a live interviewPractice solo
3 test cases. No second person needed.