I am going through a Javascript code and encountered the following construct which I am not able to comprehend.
case "RED":
return (0, h.default)(e);
Please explain what this return type is?
I am going through a Javascript code and encountered the following construct which I am not able to comprehend.
case "RED":
return (0, h.default)(e);
Please explain what this return type is?
The void operator evaluates the appended method but then returns undefined, the return value here is undefined, no matter what (0, h.default)(e)
returns.
From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/void:
console.log(void 2 == '2'); // (void 2) == '2', returns false
console.log(void (2 == '2')); // void (2 == '2'), returns undefined