Javascript Quiz: How well do you know Closures in JS #programming #javascript #coding #quiz

preview_player
Показать описание
Are you ready for another code challenge? Join me in this video as you test your coding knowledge with the simple quiz questions.

Don't forget to make your guess in the comments below.

-------------------------------------------------------------------------------------------

🔔Like and subscribe for more videos. 🔔

Connect me on linkedin :
------------------------------------------------------------------------------------------

Answer OPTION: C) 10, 5

Explanation:
The code defines a global variable x with a value of 5. Inside the outer function, there is a local variable x with a value of 10. The inner function is defined within the scope of outer.

When inner is executed, it logs the value of the local variable x, which is 10. Therefore, the first output is 10.

After outer is executed, the code logs the value of the global variable x, which is 5. Therefore, the second output is 5.

Hence, the overall output will be 10, 5.
Рекомендации по теме
join shbcf.ru