Need explanation on this javascript code challenge. | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 5

Need explanation on this javascript code challenge.

function foo(a) { var b = 5; function bar(a) { return b + a; } return bar(b++); } console.log(foo(8)); // Answer 11 No matter what parameter value I call foo it still came out 11.

28th Mar 2021, 2:55 PM
Apongpoh Gilbert
Apongpoh Gilbert - avatar
3 Réponses
+ 5
foo calls bar Check chat room
28th Mar 2021, 3:11 PM
JOY
JOY - avatar
+ 3
Apongpoh Gilbert welcome bro
28th Mar 2021, 3:17 PM
JOY
JOY - avatar
+ 2
Saw it bro thanks
28th Mar 2021, 3:17 PM
Apongpoh Gilbert
Apongpoh Gilbert - avatar