var vs let vs const
No fluff lets get directly into it ! var vs let vs const Declaration var : Can be re-declared even after declaring it once ! let : Cannot be re-declared ! Only one declaration per block ! const : Same as let ! Mutability var : Mutable. Means will let you change values of variables, let : Mutable. Same as var will let you change values of variables. const : Immutable. Won’t let you change values of variables declared using const ! Scopes var: Function Scoped ! function scopeOfVar(){ var x = 8; console.log(x); } scopeOfVar(); console.log(x); //ReferenceError: x is not defined x is defined inside the function, hoisted to the top of the scope (the function in this case) and is not accessible outside of the function. ...