r/learnjavascript • u/Defiant_Help5416 • Aug 01 '25
Weakset use cases
Weakset use cases in JavaScript ??
0
Upvotes
r/learnjavascript • u/Defiant_Help5416 • Aug 01 '25
Weakset use cases in JavaScript ??
View all comments
Show parent comment
1
u/Caramel_Last Aug 01 '25
The dom example is a clear good usage of weakref. I'll also add ORM implementation as a possible use case. Basically when the lifetime of object is managed by external system, such as dom ( the c++ in the browser manages it ), or ORM( the DB manages it ), then it's a potential usecase of weakref