Skip to content

Instantly share code, notes, and snippets.

@ericelliott
Created January 3, 2017 21:23
Show Gist options
  • Select an option

  • Save ericelliott/7692616a6d2d1061a76603303521ea07 to your computer and use it in GitHub Desktop.

Select an option

Save ericelliott/7692616a6d2d1061a76603303521ea07 to your computer and use it in GitHub Desktop.
Frozen object
const a = Object.freeze({
foo: 'Hello',
bar: 'world',
baz: '!'
});
a.foo = 'Goodbye';
// Error: Cannot assign to read only property 'foo' of object Object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment