// 'use strict'; // ⭐ toggle sloppy/strict mode// ⭐ "redeclarations": (2)// ------------------------------// • assignments are always applied. // (in both sloppy/strict mode)// ⭐ "function in block": (3)(4)// ------------------------------// • sloppy mode:// • is visible outside the block.// • can be considered a "redeclaration".// • but the assignment is not applied until the block is run❗// ((3) is NOT run, (4) is run.)//// • strict mode:// • is "local" to the block.// • never is a "redeclaration".// ⭐ "if-false-block"if (false) {// (3)// -------------------------------// • sloppy mode:// "redeclaration" NEVER happens. (because it never runs)// • strict mode:// "function in block" is local to the block,// it never is a "redeclaration".functionfoo() { return3 } // this line never runs❗}// ⭐ "if-true-block"if (true) {// (4)// ---------------------------------// • sloppy mode:// "redeclaration" DOES happen. (because it runs)// • strict mode:// "function in block" is local to the block,// it never is a "redeclaration".functionfoo() { return4 } // this line always runs❗}// (1)// ⭐️ function declaration// -------------------------functionfoo() { return1 }// (2)// ❗ function re-declaration// ---------------------------// • declaration: ignored// • assignment : applied❗functionfoo() { return2 }// logconsole.log(foo()); // • sloppy: 4 ❗// • strict: 2 ❗