Skip to content
Junior–Senior163 views

Addition function that works as a regular call and through currying

Task condition

Create a function that adds two numbers. The function should work correctly when both arguments are passed at once, as well as when they are passed one by one — i.e., support curried calls. Example usage:

add(2, 3); // 5
add(2)(3); // 5
Frontend tasks in the code trainer