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 expressionSpecial operator allows us to return the undefined type from an evaluated expression.

Parameters

Parameter Description
expressionThe 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));

Press the button below to action the above code: