Skip to content

Instantly share code, notes, and snippets.

@h3nr1ke
Created December 20, 2018 17:09
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/f53063a19aeb7b3db55836caa895372d to your computer and use it in GitHub Desktop.
Save h3nr1ke/f53063a19aeb7b3db55836caa895372d to your computer and use it in GitHub Desktop.
const example ECMA 6
/**
* Constant as an array
*/
const OBJ = ["foo","bar"];
console.log(OBJ);
// chaging the value of a constant "variable" =)
// no errors displayed
OBJ[0] = "another value";
OBJ[1] = "example text";
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