Loading...
intermediate
Problem 05 • Step 01
The make-adder Pattern
The evaluator is complete — you don’t need to change it. Instead, you’ll write a program in the language.
make-adder is a function that takes a number x and returns a new function. The returned function takes y and adds x + y.
In JavaScript:
const makeAdder = (x) => (y) => x + y;
const add3 = makeAdder(3);
add3(10); // -> 13
You already know how to express functions in our language. Think about what make-adder needs to return.