1 minute read
The old standby. var can place variables in either the global scope or a function's scope. var is subject to hoisting!
var x = 10;
const YEAR = 2018;
It's convention to capitalize all the letters of a constant variable.
New to ES2015. let allows you to establish the block scope of a variable and it has a few special rules:
let x = 10;