Skip to content

Tag: weakmap

WeakMap with event.target

Edit: turns out nothing is actually wrong with the second snippet (my real code). On one page it works, and on another it doesn’t. Yea for underlying errors. I’m creating a DOM element and giving that DOM element to a WeakMap as a key. Then, with JQuery event delegation/event listener, I’m t…

How to iterate over a WeakMap?

A JavaScript WeakMap does not allow you to get the key, or the length or size, by design. Is it possible to nevertheless loop over entries in some way ? If not .. how does the Chrome console do this ? Answer Is it possible to nevertheless loop over entries in some way? No, as you say, the contents of