Skip to content

Instantly share code, notes, and snippets.

@subzey
Created September 20, 2012 07:33
Show Gist options
  • Select an option

  • Save subzey/3754437 to your computer and use it in GitHub Desktop.

Select an option

Save subzey/3754437 to your computer and use it in GitHub Desktop.
#!/usr/bin/env node --harmony --expose-gc --gc-global
var map = new WeakMap();
var key = {};
var value = {foo: 42};
map.set(key, value);
value = null; /* unreference */
gc();
console.log(map.get(key));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment