Last active
April 10, 2016 10:04
-
-
Save codemilli/1efc235f38f61530efb9b29f2b1c2acb 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 ws = new WeakSet(); | |
let value = {a: 'hacker'}; | |
ws.add(value).add({b: 'moon'}); | |
console.log(ws); // WeakSet {Object {a: "hacker"}, Object {b: "moon"}} | |
// after the garbage collector has run | |
console.log(ws); // WeakSet {Object {a: "hacker"}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment