Skip to content

Instantly share code, notes, and snippets.

@jaamaalxyz
Last active February 27, 2018 04:41
Show Gist options
  • Save jaamaalxyz/9b5dd35f33eb944e1454e8e912f78129 to your computer and use it in GitHub Desktop.
Save jaamaalxyz/9b5dd35f33eb944e1454e8e912f78129 to your computer and use it in GitHub Desktop.
// const type variable declaration
const PI = 3.14; // Global value of pi
const TAX_RATE = 8.5; // maybe your tax rate 8.5%
const INTEREST_RATE = 12; // Bank interest rate is 12%
// output
console.log(PI); // 3.14
console.log(TAX_RATE); // 8.5
console.log(INTEREST_RATE); // 12
// If we want to make change const type variable, we get TypeError
PI = 3.1416; // TypeError
// If we want to reassign any const type variable, we get SyntaxError
const INTEREST_RATE = 15; // SyntaxError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment