0

I'm trying to understand the syntax of the following made-up function:

const z = (a, b) => (a +=b, a)

I know this is equivalent to

const z = (a, b) => {
    a += b;
    return a
}

But I'm trying to understand why this is syntactically the case. I think my misunderstanding comes from the use of () and , after the =>

ted
  • 11,582
  • 6
  • 55
  • 96

0 Answers0