"In JavaScript, neither weak references... is generally available". I think that was true with the old weak collation classes, but doesn't the newer JS WeakRef provide proper weak references?
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
https://freudenbergs.de/vanessa/publications/Freudenberg-201...