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 ?
Limited Time Offer
25%
Off
Willow
1 months agoHayley
10 days agoCharlesetta
1 months agoMireya
1 days agoTish
2 days agoLuisa
4 days agoProvidencia
8 days agoJovita
9 days agoUna
17 days agoDana
2 months agoSharen
24 days agoAileen
29 days agoCeleste
1 months agoBrandon
1 months agoHuey
2 months agoQuentin
1 months agoDelila
2 months agoChara
2 months agoSvetlana
2 months agoTyisha
2 months agoSvetlana
3 months ago