JavaScript Void Operator
When an expression is evaluated using the void operator, the result is undefined. This operator is typically used to obtain an undefined primitive value. It’s frequently used in conjunction with hyperlinks. When you click a link, your browser usually refreshes the page or loads a new one. When we don’t want the browser to refresh or load a new page when we click a hyperlink, we can use javascript:void(0). The operand 0 can be used in two ways: void(0) or void 0. Both methods are equally effective. JavaScript:void(0) instructs the browser to “do nothing,” preventing the page from being...
Read More