Last active
April 10, 2016 10:17
-
-
Save codemilli/24d95dc50f94b66a84403d1e37b85b0b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let wm = new WeakMap(); | |
| let key = {a: 1}; | |
| wm.set(key, 1).set({b: 2}, 2); | |
| console.log(wm); // WeakMap {Object {a: 1} => 1, Object {b: 2} => 2} | |
| // after the garbage collector has run | |
| console.log(wm); // WeakMap {Object {a: 1} => 1} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment