Can you clarify your use cases? I didn't understand what you meant by wanting to add some additional values to objects.
I've know about WeakArrays and WeakMaps in other languages for a long time. But the only scenario where I found them maybe useful was for listeners/observers. When you register a listener on your object maybe you don't want to prevent that object from being garbage collected.
But I came to this article hoping for more examples of usefulness.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Can you clarify your use cases? I didn't understand what you meant by wanting to add some additional values to objects.
I've know about WeakArrays and WeakMaps in other languages for a long time. But the only scenario where I found them maybe useful was for listeners/observers. When you register a listener on your object maybe you don't want to prevent that object from being garbage collected.
But I came to this article hoping for more examples of usefulness.