void
special operator
JS Home <<
JS Reference <<
void
Defer to undefined
.
Description
The void
special operator allows us to return the undefined
type from an evaluated expression.
Syntax
Signature | Description |
---|---|
void expression | Special operator allows us to return the undefined type from an evaluated expression. |
Parameters
Parameter | Description |
---|---|
expression | The evaluated expression to evaluate. |
Returns
The undefined
global variable type.
Example
The code gives an example of using the void
special operator.
// Using the void special operator.
alert(2*2);
alert(void(2*2));