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

The only code affected by this would be code that uses typeof to check for the existence of a variable the same code defines later, which sounds like dumb code to begin with. I don't think there's any valid uses of typeof on possibly undefined variables besides checking for browser built-ins.


Using typeof(foo) === "undefined" is actually something that comes from back when it was pretty common to pollute the global namespace. There were actual javascript plugins/libraries/snippets that defined undefined and thus broke code that compared to it.




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

Search: