Are lapsed listeners preventable in javascript?
问题 My question is really "Is the lapsed listener problem preventable in javascript?" but apparently the word "problem" causes a problem. The wikipedia page says the lapsed listener problem can be solved by the subject holding weak references to the observers. I've implemented that before in Java and it works nicely, and I thought I'd implement it in Javascript, but now I don't see how. Does javascript even have weak references? I see there are WeakSet and WeakMap which have "Weak" in their names