Answers for "what is a curried function"

0

what is a curried function

Curried Function
// Non-curried
function add(a, b, c) {
  return a + b + c
}

add(1, 2, 3)
//-> 6

// Curried
function addd(a) {
  return function (b) {
    return function (c) {
      return a + b + c
    }
  }
}

addd(1)(2)(3)
//-> 6
Posted by: Guest on November-20-2020

Browse Popular Code Answers by Language