Different types of currying and how to use them for problem solving

I don’t need the whole world, just you

Let’s look at the example of a curry function in JavaScript:

In this article I’ll quickly introduce you to currying, it’s purpose, and show you how to understand it with plain and simple code.

What is currying?

Currying is the process of converting a function of multiple arguments to a chain of functions of one argument. Like so:

const createUser = (firstName, lastName) => 
`${firstName} ${lastName}`
// becomes
const createUser = (firstName) => (lastName) =>
`${firstName} ${lastName}`

But it’s not comfortable to do those manipulations manually every…

Почему Вы бы хотели тратить свое время на чтение о такой сложной теме?

Потому что лямбда исчисление:

  • классное!
  • представляет основы любой…

Why would you want to spend your time reading about such a complex thing? Because lambda calculus:

  • is awesome!
  • represents the…

The point of this article is to show you how to write your code like a story that everyone can understand.

Why?

Why would I want to? Because code is for humans, not machines. …

Ivan Korolenko

https://ivankorolenko.com | Senior front end engineer | Turning wishes into software

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store