const add = (a,b) => a+b
const adder = a => b => a+b
const curry = fn => a => b => fn(a,b)
// curry(add) is identical to adder

TL;DR Summary

How are the above functions related?

  • add is an ordinary binary function: add(2,3)

Introduction

Currying is a somewhat advanced technique that has a simple precept — it converts a function that takes multiple arguments…

Patrick McDermott

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