In my experience, let cannot be redeclared in it’s own scope but it’s value can be reassigned and modified. let a = 5 when a is already defined in that scope with throw an error, but a++ will not. Correct me if my bad memory is messing me up though.
there is nothing as modified as soon you change a value of a variable, you reassign its value. This you can do with any variable declared via let and var, but not with const. redeclaration will always yield an error, except on var.
0
u/WaterNinja101 May 04 '20 edited May 04 '20
In my experience, let cannot be redeclared in it’s own scope but it’s value can be reassigned and modified.
let a = 5when a is already defined in that scope with throw an error, buta++will not. Correct me if my bad memory is messing me up though.EDIT: reworded the first bit