-1

I understand the array operation in javascript is a shorter syntax of function expression. However, I don't understand the following code when several =>s put together, what does it mean?

const logger = store => next => action => {
  let result = next(action)
  return result
}
Qian Chen
  • 14,824
  • 18
  • 61
  • 88
  • 5
    It means someone is abusing readability for the sake of brevity. – Jamiec Sep 30 '16 at 10:38
  • 1
    Curried version. Instead of having a function with multiple arguments you have a function that always has 1 argument but returns a function until it "collects" enough args. Compare `const add = (x, y) => x + y; const addCurried = x => y => x + y` – Yury Tarabanko Sep 30 '16 at 10:41

1 Answers1

2

This is a curried function.

There is an in-depth description here: What do multiple arrow functions mean in javascript?

Community
  • 1
  • 1
Andrew Burns
  • 360
  • 4
  • 10