The only time to worry.

Stavnes: There is no way to unset a variable as though it had never been set, though delete is the closest thing

Stavnes: But the right answer is “don’t try to do that”

Keitsock: FffuuuL: if you are done using a variable, simply stop referencing it

Sagayaga: Rawhouser: I think you said something about MDN polyfills being buggy. Yeah. Even a ****ing array.reduce polyfill there just totally ****s up in IE8.

Sagayaga: How hard is it to implement a fold.

Neyhart: Keitsock: What does it mean, not to reference

Corbo: When does one not reference a variable anymore

Nodarse: FffuuuL: when it goes out of scope you can access.

Nodarse: Reference ~= use variable by its name

Semel: I see, well, basically i do var d = new Datefoo; then use d to have a short name to access functions an after that will never use it again in that function

Kozicki: I explicitly wrote d = null; at the end of the if tho

Nodarse: FffuuuL: no need for that

Stavnes: FffuuuL: why would you ever do anything at all like that?

Nodarse: Well, no, you are not “freeing space”

Stavnes: You’re using a date as a name of a function?

Kalfas: An argument for function calls?

Grasmuck: I have a variable in the function “current_event_element” that holds the current event element, now i need the date that it holds

Nodarse: Space is already free, it’s huge in any possible direction!

Wittel: So instead of new Datecurrent_event_element.datevalue.getDay i could instead do d.getDay

Schuttler: But afterwards i wanted to free the space that d took in memory

Nodarse: FffuuuL: if you use it only once, what’s the point?

Kurutz: The point of using a variable?

Policastri: Nod****: i ccontruct a date

Stavnes: Ok, a shorter variable name is fine

Siurek: FffuuuL: how big your application has to be that your caring about memory management

Lopiccalo: Any good free replacements for webstorm? aptana looks decent

Stavnes: It will be freed automatically just like every other variable

Greisser: Does it make a difference if i “nulll” it?

Stavnes: That’s what “garbage collection” means

Baragan: FffuuuL: the only thing if you set it to null is that it calls the memory again

Ekwall: I wanted to do delete d;

Gerrero: Stavnes: Stop worrying and TRUST THE GARBAGE COLLECTOR.

Krenzke: But delete only works on object properties i read

Rizor: Just make sure you are using functions and not global variables

Mclay: It’s all scoped within my function

Stavnes: Delete would be what you wanted, if that was at all necessary, but it’s not

Stavnes: So just forget the whole thing

Hentrich: Js var a = 42; delete a; a

Rizor: GC will take care of it but only when there are no more references to that data alive in your code

Zukof: Js var a = 42; delete a

Gerrero: FffuuuL: boolean false

Rizor: It’s usually nothing to worry about unless you do something weird

Cerecer: I never rly came to the point that I’D have to care about memory management AT ALL

Siddiqi: 15:48:29 Xatenev: in JS

Keblish: You better catch it or it will hurt you!

Stavnes: It’s a good thing you don’t need to, since you also can’t

Gerrero: Stavnes: Stop worrying and TRUST THE GARBAGE COLLECTOR.

Whiteaker: Btw any nice frontend dev here who wanna help me out in a private project? 😛

Stavnes: The bot only likes people who are trusting


Rizor: The only time to worry about GC is if you’re profiling your app and find a leak or high usage