Created
May 7, 2020 18:19
-
-
Save Nathan-Nesbitt/092844792a46ae99f5746f684ed3dd03 to your computer and use it in GitHub Desktop.
Constant Variables Example
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
// Creates a constant variable // | |
const myConstant = 10; | |
// Tries to reassign the variable but will | |
// throw TypeError: invalid assignment to const `myVariable' | |
myConstant = 11; | |
// Prints 10 // | |
console.log(myConstant); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sample code for https://nathan.nesbitt.ca/blog-posts/IntroductionToJavascript.html