Single Choice
Not Set
QWhat is the result of the following code?
console.log(5 + 5 + '5');
ID: #4860
JavaScript Operator MCQ
303 views
Question Info
#4860Q ID
Not SetDifficulty
JavaScript Operator MCQTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer
Explanation
The result of the code is '105'.
In JavaScript, the + operator has two different meanings depending on the type of the operands.
If at least one of the operands is a string,
the + operator performs string concatenation.
In this case, the first 5 is converted to the string '5',
and the second 5 is also converted to the string '5', so the final result is '105'.
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic