ā||š¤¢ Commit or Vomit | function currying š
š¤š„ Jasper de Jager
Posted on April 30, 2021
Function currying
Hard to put vomit and curry together in a title, but I had to ask š
I see this posted a lot on dev.to, function currying, but I find it not that readable myself TBH. What do you think?
And please tell me why š
// edit::
// It is about the concept of currying so changed to a
// better way of writing
// I'll leave the first version at the bottom
// for the comments that are already in!
const multiply = a => b => c => a*b*c
console.log(multiply(1)(2)(3)) // 6
// initial code block
function multiply(a) {
return (b) => {
return (c) => {
return a * b * c
}
}
}
console.log(multiply(1)(2)(3)) // 6
function currying ā||š¤¢?
ā¤: Commit (I'd commit something like this)
š·: Vomit (we all know unicorns don't vomit)
š¦: Like your post please continue this series!
Let's vote! š
Photo by Jason Leung on Unsplash
š šŖ š
š©
š¤š„ Jasper de Jager
Posted on April 30, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.