Javascript Quiz: How Well Do You Know 'Function' #programming #javascript #coding #quiz #js

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. 🔔

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

Answer: OPTION B

Explanation:
The variable x is declared and assigned the value 5 outside of the function. Inside the function, a new variable x is declared and assigned the value 10.

This inner variable x only exists within the scope of the function, and does not affect the value of the outer variable x.

So when the function is called, it will log 10 to the console. After the function call, the outer variable x is still 5, so it will log 5 to the console.
Рекомендации по теме