1

What on earth is this syntax?

return (0, _hoistNonReactStatics2.default)(C, Component);

Are they specifying the function to be called inside of a parenthesis and together with a number? Why?

I have tried the following but I still don't understand what the leftmost parenthesis clause means or does.

> f=function(args){console.log(args)}
> (0, f)(1, 2)
1
> (f, 0)(3, 2)
TypeError: (f , 0) is not a function

Please help whoever can.

Aaqib
  • 7,595
  • 3
  • 17
  • 25
Ola Vikholt
  • 51
  • 1
  • 3

1 Answers1

-1

It's using the comma operator which takes a comma separated list of expressions and returns the value of the last one.

See this question for a valid use case.

adz5A
  • 1,768
  • 7
  • 9