top of page

Java Script

Known as 

"let"

"const"

"var"

Declaration

        let  = Lets set a variable that can be mutated/altered later

let  age  =  23;

 age = 24;      

No console error

      constset constant variable that should not be mutated/altered later

const  birthYear  =  1980;

 birthYear = 1981;

Uncaught TypeError

     var = should not be used in modern (2016+) Java script.

     var;   was the precursor to let  and const , found only in pre 2016 Js code.

A declaration of   let  declares a  set of Variables that can be altered.

A declaration of   const  declares a set of Variables that should not be altered.

var is pre 2016 JS update and was used before the introduction of   let  and  const 

bottom of page