Re:Track down the JavaScript code responsible for polluting ...
by sli on Wednesday February 16, 2022 @11:19PM
(#30369472)
I've known about JS scope lifting for a very long time but even still I had no idea that it would lift iterators in a for-loop all the way to global scope and not just to the function scope without strict mode, that's nuts.
[ Parent
| on HN ]
Re:Track down the JavaScript code responsible for polluting ...
by mattwad on Wednesday February 16, 2022 @11:47PM
(#30369608)
Well, any time you define a variable without var/let/const, I just imagine it's being defined as a property of the global state. I remember back in the day having to remind people to even use `var`.