Do you know what will be the output of this code?
JavaScript
console.log(typeof notDeclared);
Show answer and explanation
The answer is "undefined".
typeof is the one operator that is safe to use on undeclared identifiers. It was designed that way for feature detection, like typeof window !== "undefined".
It does throw inside a temporal dead zone (let before its declaration).