1. Home
  2. Javascript
  3. Var let const

Es6 introduced 'let' and 'const' to register variables. By default use 'let' to indicate that the variable can mutate or be reassigned, otherwise use 'const'. The use of 'var' has been limited to use in the global scope.

#javascript#es6
let a = "5" // Use by default
const day = "Monday" // Assume that the value doesn't change
var theme = "sunrise" // Mainly used for global variables
copy
Full Javascript cheatsheet