Skip to content

Instantly share code, notes, and snippets.

@agoiabel
Created April 14, 2018 07:09
Show Gist options
  • Select an option

  • Save agoiabel/a8d2f5167fd9b945a100bff8f53531c1 to your computer and use it in GitHub Desktop.

Select an option

Save agoiabel/a8d2f5167fd9b945a100bff8f53531c1 to your computer and use it in GitHub Desktop.
//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