What does the following JavaScript code print (console output, as in Node.js)?
const level = "global";
function show() {
return level;
}
function run() {
const level = "local";
return show();
}
console.log(run());
Scope is lexical: show() was written at the top level, so it reads the top-level level, no matter that run() calls it.