Q:

What is a JavaScript Void 0?

A:

In JavaScript, a Void 0 is a programming tool that is used to prevent a browser from loading a new page. It is used in connection with a JavaScript Alert.

Web browsers will evaluate the uniform resource locator, or URL, in a line of code and attempt to load the page. A JavaScript void operator returns a value of null and so the browser does not load the new page. In this way, a scripter can force the keyword to be treated as an expression and not as a declaration in cases where the JavaScript statement is used as a URL that returns a value. Undefined can be used in place of void unless it has been otherwise assigned.


Is this answer helpful?

Similar Questions

Explore