Single Choice
Easy
QWhat is the result of the following code?
var num = 10;
num++;
console.log(num);
ID: #4885
Javascript Data Types MCQ
263 views
Question Info
#4885Q ID
EasyDifficulty
Javascript Data Types MCQTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer
Explanation
The ++ operator in JavaScript is an increment operator, which increments a number by 1.
In this case, the variable num is initially assigned the value 10, which is a number.
On the second line, num is incremented by 1 using the ++ operator.
Therefore, num now has a value of 11, and when it is logged to the console, the value 11 will be displayed.
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic