Skip to content

Instantly share code, notes, and snippets.

@h3nr1ke
Created December 24, 2018 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save h3nr1ke/9f08da581275e94f64dc773fe99662c9 to your computer and use it in GitHub Desktop.
Save h3nr1ke/9f08da581275e94f64dc773fe99662c9 to your computer and use it in GitHub Desktop.
const example with object.freeze
/**
*/
const OBJ = {
prop1 : 1,
prop2 : 2,
propA : "A",
propB : "B",
};
OBJ.prop1 = 3;
console.log(OBJ);
Object.freeze(OBJ);
OBJ.prop1 = 1; // nothing happens
console.log(OBJ);
// END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment