Closures & Functions

Currying with Placeholder Support

hardJS SpecificJS / TS3 tests

Problem Statement

Implement currying with placeholder support. Allow passing `curry.placeholder` (or `_`) to leave an argument unsupplied to be filled by subsequent invocations.

Examples

Example 1:
const fn = (a, b, c) => [a, b, c];
const curried = curryWithPlaceholder(fn);
const _ = curryWithPlaceholder.placeholder;
curried(_, 2)(1, 3); // [1, 2, 3]
JavaScript & TypeScript starter code included
Run this as a live interview

Practice solo

3 test cases. No second person needed.

Get new interview exercises

Practice problems and review drills, sent when we publish new ones. No spam.

Unsubscribe anytime. We never share your address.