Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

what is weakmap and weakset in javascript

/*
	SIMPLE EXPLANATION:

	The WeakMap takes only objects as keys. 
    When one object is not being referred to anymore, it and its
    associated value will get removed from the WeakMap.

    The WeakSet functions similarly.
    Its values are unique and are only objects.
    When one object is not being referred to anymore, it will get removed
    from the WeakSet.
*/
 
PREVIOUS NEXT
Tagged: #weakmap #weakset #javascript
ADD COMMENT
Topic
Name
1+1 =