
Things JavaScript Developers Should Know, Part 2 - JSJ 485
JavaScript Jabber
00:00
Using a Weak Raff in Closing
An event handler keeps data in a storage that you reference from. As long as that event handler is there, you just get your comulating more and more data every time that event handleris triggered. But if you'd have no interest in it any more, then why keep it? So what they did is, in the closure, instead of having a regular reference to that storage, they actually used a week reference,. They checked whether or not they got back undefined or not. And e we won't put any more data in it because, you know, there's nowhere to put the data. i've never used a weak raft. I'm totally not sure that i will use a week
Play episode from 56:09
Transcript


