JavaScript & jQuery Tutorials

JS Home Right Arrow JS Reference Right Arrow void

void special operator

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:



  

go to home page Homepage go to top of page Top