A Guide to Currying in JavaScript

javascript react es6 currying functional programming
A Guide to Currying in JavaScript

Hello everyone, I’m back with yet another article, this time on a concept in JavaScript which is called currying.

Before I start on the concept itself, let’s first dive into the origins of currying.

The name “currying” was coined by Christopher Strachey in 1967. Currying has a lot of mathematical and computer science theories behind it. The concept is named after the mathematician Haskell Curry.

Currying is a concept that is used in functional programming. Functional programming is a programming paradigm. A style of building the structure and elements of computer programs that treat computation as the evaluations of mathematical functions and avoids changing state and mutable data.

Now back to the main topic: what is currying?

Currying is a process in functional programming in which we can transform a function with multiple arguments into a sequence of nesting functions. It returns a new function that expects the next argument inline.

Discussion

3

0