Created
December 20, 2018 17:09
-
-
Save h3nr1ke/f53063a19aeb7b3db55836caa895372d to your computer and use it in GitHub Desktop.
const example ECMA 6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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