Photo by on Johnson Cameraface Flickr In many languages, is a type that has no values. In JavaScript, is a operator that takes an operand and return . This is not useful, and it is very confusing. Avoid . ~ Douglas Crockford. void void undefined void JavaScript: The Good Parts If you agree with that statement I do not want to waste your time, jump out from here and keep saving the world. 😎 If not, let’s discover why void is useful and you should not avoid it. Why void confuses? 😰 😱 😵 void 0 === undefined //true Why? How? What is void? Is this even JavaScript? Answers which I got when asked developers about the void and the main confuse here is that developers forgot or have not known or find strange. The evaluates the given and then returns . That is all what you need to know about operator. [**void**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/void) operator _expression_ [undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined "The global undefined property represents the primitive value undefined. It is one of JavaScript's primitive types.") void How void can be useful? 1. Evaluate expression and jump out from a function One time I’v done a code review and found a method like that: function doStuff(a) {if (a) {doSomething()} else {doSomethingElse()return} doSomethingMore() } So, from this method you may see that in case we return and jump out from the function. Let’s save one line and make it more readable with . doSomethingElse() undefined void function doStuff(a) {if (a) {doSomething()} else {return void doSomethingElse()} doSomethingMore() } From void description you know that it evaluates and return . That exactly what we need 👍 doSomethingElse() undefined 2. Check for undefined Old browsers allowed to be re-assigned . However, this was fixed in 2009 with ECMAScript 5. undefined undefined = 'test' _This is an annotated, hyperlinked, HTML version of Edition 5.1 of the ECMAScript Specification, the source for which is…_es5.github.io Annotated ES5 If you need to support old browser e.g. IE8, here is a helper function 😊 function isUndefined(value) {return value === void 0} 3. preventDefault() behavior for a link We all know that tag without attribute is not valid, but in HTML5 attribute is not required, so you can omit. a href href _Similarly, for and elements with an href attribute and a attribute, links must be created for the keywords of the…_www.w3.org HTML 5.1: 4.8. Links Somehow, if you need to prevent works use . href void <a href="javascript: void(0)">About</a> 4. Immediately Invoked Function Expressions When using an , can be used to force the keyword to be treated as an expression instead of a declaration. immediately-invoked function expression void function void function IIFE() { // do something ...}() Conclusion is a simple operator and I find it useful. I guess, more developers do not use it because they have not touched it while learning. Of course, if a team find it confused better to discuss. In help, ESLint has the rule ( ). Happy coding! 😎 void no-void 👏 Thank you for reading. Suggestions, comments, thoughts are welcome :) ✌️ If you like this, clap, follow me on medium , twitter , github share with your friends