āœ”||šŸ¤¢ Commit or Vomit | function currying šŸ›

šŸ¤šŸ„‡ Jasper de Jager - Apr 30 '21 - - Dev Community

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


Enter fullscreen mode Exit fullscreen mode

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

. . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player