Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The same is true with undefined. You should use void 0 rather than undefined because undefined is just a normal variable which happens to be undefined unless somebody defines it, while void 0 is always going to be undefined.


There is absolutely no need to use `void 0` you can simply use `typeof` or create a local `undefined` var. Many libs do this in their IIFE `(function(undefined) { /* your code */ }());`. The point was there isn't a real world performance concern to justify using one over the other.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: