Created
April 14, 2018 07:09
-
-
Save agoiabel/a8d2f5167fd9b945a100bff8f53531c1 to your computer and use it in GitHub Desktop.
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
| //Old way of using var | |
| var myAge = 27; //this can change | |
| var myGender = "Male"; //this cannot change | |
| //To express the above in the new way | |
| let myAge = 27; //I use let because my age will always change | |
| const myGender = "Male"; | |
| /** | |
| * Below will give a Type Error: | |
| * because a predefined const should not change | |
| */ | |
| myGender = "Female"; //Error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment