JS void keyword? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

JS void keyword?

What is void keyword? How to use?

16th Mar 2017, 10:22 PM
Валерий Чкалов
Валерий Чкалов - avatar
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>
17th Mar 2017, 5:19 PM
Валерий Чкалов
Валерий Чкалов - avatar