Skip to content

Instantly share code, notes, and snippets.

@h3nr1ke
Last active December 20, 2018 17:05
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/145e9fde011901aabca21db1862d7dc9 to your computer and use it in GitHub Desktop.
Save h3nr1ke/145e9fde011901aabca21db1862d7dc9 to your computer and use it in GitHub Desktop.
const example ECMA 6
/**
*
*/
const OBJ = {
prop1 : "foo",
prop2 : "bar",
prop3 : 100
}
console.log(OBJ);
// chaging the value of a constant "variable" =)
// no errors displayed
OBJ.prop1 = "another value";
OBJ.prop2 = "example text";
OBJ.prop3 = 453;
console.log(OBJ);
// but if you try to change the structure it self
// ERROR...
OBJ = {newProp : "qwerty"};
// END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment