Scopes & Reassigning
Const and Let inside of scopes and reassigning them
Constant scope
const variable = 'test';
if (true) {
console.log(variable);
} $ node .
"test"Reassign in different scope
Truely if-statement
let variable = 'test';
if (true) {
variable = 'maybe';
}
console.log(variable);Falsely if-statement
Constant in wrong scope
Reassigning
Last updated