For the first time I met this method of setting a variable. I'm a little tangled up with double brackets. What does this mean?
var defaultState = (0, _state2.default)(servicePath, stateOptions);
For the first time I met this method of setting a variable. I'm a little tangled up with double brackets. What does this mean?
var defaultState = (0, _state2.default)(servicePath, stateOptions);
(0, _state2.default)
is an expression which contains comma operator. It evaluates to its last operand. Here _state2.default
is last operand. So
(0, _state2.default)(servicePath, stateOptions);
Is same as
_state2.default(servicePath, stateOptions);
The second brackets call the function with two arguments.
The first ()
are used to group an expression. While the second ()
are used to call the function.