12 ms·
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
by AgentME 11y ago
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.
- mAritz 11y agoUsing 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.