Hoisting from today's js interview call
........this is saying copilot: Hoisting with let and const: In summary, while all declarations (including let, const, and var) are hoisted, the behavior differs: - var variables are hoisted with default initialization (value: undefined). - let and const variables are hoisted without initialization, leading to a temporal dead zone where they cannot be accessed before declaration12. - ................................This is from MDN docs: - let declarations can only be accessed after the place of declaration is reached (see temporal dead zone). For this reason, let declarations are commonly regarded as non-hoisted. - (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let) - const declarations can only be accessed after the place of declaration is reached (see temporal dead zone). For this reason, const declarations are commonly regarded as non-hoisted. - (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const)