The void operator evaluates an expression and then returns undefined.
In this example,
void(0) is used to return
undefined to the link’s
href property, so that the browser will not attempt to load a URL and the function in the
onclick event can be executed instead.
The void operator evaluates its expression and returns undefined. It is useful in situations where an expression should be evaluated but you do not want a result returned to the rest of the script.
Void works only on unary expressions, thus:
void x, y; will set only the x variable to undefined.
void(0) is equivalent to void 0 and returns the undefined value.
Microsoft Developer Network: Article