Skip to content

Instantly share code, notes, and snippets.

@uupaa
Last active August 29, 2015 14:17
Show Gist options
  • Select an option

  • Save uupaa/c921c2cf964904cf07db to your computer and use it in GitHub Desktop.

Select an option

Save uupaa/c921c2cf964904cf07db to your computer and use it in GitHub Desktop.
Object.freeze, Object.isFrozen, WeakMap, localStorage

in Chrome

var a = { a: 1 };

var map = new WeakMap();

Object.freeze(map);
Object.isFrozen(map); // -> true
map.set(a, "123");
map.get(a);           // -> "123"  oh, no
Object.freeze(localStorage);
Object.isFrozen(localStorage); // -> false  really?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment