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 agoHelaine
2 days agoHayley
15 days agoCharlesetta
1 months agoMireya
6 days agoTish
7 days agoLuisa
9 days agoProvidencia
13 days agoJovita
14 days agoUna
22 days agoDana
2 months agoSharen
29 days agoAileen
1 months agoCeleste
1 months agoBrandon
2 months agoHuey
2 months agoQuentin
1 months agoDelila
2 months agoChara
2 months agoSvetlana
3 months agoTyisha
3 months agoSvetlana
3 months ago