Javascript Quiz: How Well Do You Know '++' operator #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. 🔔

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

Answer: OPTION C) 7 5 6

Explanation:
The ++ operator increments its operand by 1.
When used before the variable name (++x), it increments the variable before it is used.
When used after the variable name (x++), it increments the variable after it is used.
In this case, y is assigned the value of x (5) before it is incremented, so its value is 5. z is assigned the value of x (6) after it is incremented, so its value is 6.
The output of the code is 7 5 6.
Рекомендации по теме
Комментарии
Автор

You are using 'const' then how you can change the value of the variable x. You should use 'let' Or 'var'

SaiRam-xbsn