February 14, 2018
2 min read
void keyword is an operator that evalutes the expression following it as
void(0) (it could be any expression, but
(0) is convention). In most current development environments it would be equivalent to use
undefined instead. This seems like it would only come up when targeting older browsers, which is why
void(0) can be found in Babel transpiled code.
void true; // undefinedvoid false; // undefinedvoid 0; // undefined