--
You received this message because you are subscribed to the Google Groups "Zakas Books" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zakasbooks+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/zakasbooks/8c0ec4ae-bf69-43d4-b8f3-5f46850fca48%40googlegroups.com.
I think so but I’m not 100% sure. Browsers now have devtools that allow you to inspect memory, so I’d suggest using that to verify (these didn’t exist when the book was written).
On Fri, May 1, 2020 at 8:41 PM Mohit Kanika <kanik...@gmail.com> wrote:
Hi Nicholas,From your book "PROFESSIONAL JAVASCRIPT FOR WEB DEVELOPERS third edition", on page 227(Memory Leaks). You have provided below pattern of code to avoid memory leaks.Could you please confirm that below pattern is required in Chrome or Firefox where DOM is implemented as JS object and Mark & sweep is used as GC? i.e. do I need to always set element to null after I assign event handlers on an element?function assignHandler() {var element = document.getElementById("someElement");var id = element.id;element.onclick = function () {alert(id);};element = null;}--
You received this message because you are subscribed to the Google Groups "Zakas Books" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zakas...@googlegroups.com.