FrontendDeveloper.in

JavaScript question detail

What is a void operator

The void operator evaluates the given expression and then returns undefined (i.e, without returning value). The syntax would be as below,

void expression;
void expression;

Let's display a message without any redirection or reload

Click here to see a message

Note: This operator is often used to obtain the undefined primitive value, using void(0). Also it can be used to call asynchronous functions without waiting for the result.

Back to all JavaScript questions
Get LinkedIn Premium at Rs 399