DEV Community


Discussion on: JS interview in 2 minutes / Currying 🥘

kspeakman profile image
Kasey Speakman

Currying is mainly a way to setup a function for easier partial application -- providing only some of the function arguments. You can do partial application without currying, but it is less convenient.

// currying partial application
let add = a => b => a + b
let add2 = add(2)
// 9

// non-currying partial application
let add = (a, b) => a + b
let add2 = b => add(2, b)
// 9
Enter fullscreen mode Exit fullscreen mode
kozlovzxc profile image
Nikita Kozlov Author

Thanks 🙏 Added a note with a link to this comment to the post itself.