What value is obtained when executing the following code?
let x = 1;
function external() {
let x = 2;
function internal() {
console.log(x);
}
return internal;
}
const newFunc = external();
newFunc();
What value is obtained when executing the following code?
let x = 1;
function external() {
let x = 2;
function internal() {
console.log(x);
}
return internal;
}
const newFunc = external();
newFunc();