Why does the function bar have access to variable a?
Refer to the code below:
function foo () {
const a =2;
function bat() {
console.log(a);
}
return bar;
}
Why does the function bar have access to variable a?
A . Inner function’s scope
B. Hoisting
C. Outer function’s scope
D. Prototype chain
Answer: C
Latest JavaScript Developer I Dumps Valid Version with 144 Q&As
Latest And Valid Q&A | Instant Download | Once Fail, Full Refund
Subscribe
Login
0 Comments
Inline Feedbacks
View all comments