Currying

In this lesson you will be introduced to a method of writing functions with multiple parameter lists.

Currying is a style of defining functions where essentially every function is mapped to an expression that consists of nested anonymous functions, that in turn take one parameter each.

In other words, rather than a single parameter list, a currying function is passed or applied to multiple parameter lists.

The best way to understand currying is by looking at a simple example. Let’s define a simple summation function which adds two integers together.

svg viewer

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy