Single Choice
Easy
QWhat is the result of the following code?
var str = "Hello";
var num = 10;
console.log(str + num);
ID: #4886
Javascript Data Types MCQ
176 views
Question Info
#4886Q 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
In JavaScript, the + operator can be used to concatenate strings.
In this case, the + operator is used to concatenate the string "Hello" with the number 10
Since one of the operands is a string, the + operator will treat both operands as strings and perform string concatenation.
The result will be the string "Hello10"
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic