Refer to the codebelow:
function foo () {
const a =2;
function bat() {
console.log(a);
}
return bar;
Why does the function bar have access to variable a ?
Inner function’s scope
Hoisting
Outer function’s scope
Prototype chain
Submit