0
JS void keyword?
What is void keyword? How to use?
1 Answer
0
VoidĀ is keyword which can be used as a unary operator that appears before its single operand, which may be of any type. This operator specifies an expression to be evaluated without returning a value.
The most common use of this operator is in a client-sideĀ javascript:Ā URL, where it allows you to evaluate an expression for its side-effects without the browser displaying the value of the evaluated expression.
Ex.:
<a href="javascript:void(alert('Warning!!!'))">Click me!</a>