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

jmdejager

šŸ¤šŸ„‡ Jasper de Jager

Posted on April 30, 2021

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

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

šŸ’– šŸ’Ŗ šŸ™… šŸš©
jmdejager
šŸ¤šŸ„‡ 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.

Related