Hint
typeof on undeclared variables returns "undefined" (doesn't throw). let is block-scoped, var is not.
{
let a = 1;
var b = 2;
}
console.log(typeof a);
console.log(typeof b);undefined number
Explanation: let is block-scoped β a is not accessible outside the block. typeof a returns "undefined" without throwing. var leaks out of the block.
Key Insight: typeof on undeclared variables returns "undefined" (doesn't throw). let is block-scoped, var is not.