Re:JavaScript and Node performance coding tips to make appli...
by Skinney on Tuesday March 13, 2018 @06:28AM
(#16574969)
It's an easy thing to do in JS, it happens if you forget the `var`.
Re:JavaScript and Node performance coding tips to make appli...
by Klathmon on Tuesday March 13, 2018 @06:48AM
(#16575069)
only when not in strict mode, which is becoming more and more rare, especially in javascript codebases (as opposed to one-off scripts)
Re:JavaScript and Node performance coding tips to make appli...
by aetherspawn on Tuesday March 13, 2018 @06:24AM
(#16574941)
I think this is true because they hold a reference in window.
Re:JavaScript and Node performance coding tips to make appli...
by mulrian on Tuesday March 13, 2018 @06:35AM
(#16575011)
Sure that will prevent gc, but that doesn't mean it's a memory leak
Re:JavaScript and Node performance coding tips to make appli...
by dspillett on Tuesday March 13, 2018 @07:45AM
(#16575324)
It is if the variable is accidentally in global scope due to hoisting if it is not explicitly defined in a finer scope. Not an issue in strict mode, you'll get a reference error instead of an implied global.
Errr...