javascript-handbook

Go Back ↩

const

log = console.log
log(x) // Uncaught ReferenceError: Cannot access 'x' before initialization
const x // error const declarations must be initialized
log(x) // undefined
const y = 12
log(y) // 12
y = 13 //  error Assignment to constant variable.