JavaScript · Junior · Question 12 of 75
What are '5' + 3 and '5' - 3?
- ✓Correct answer:
'53'and2 - 2
8and2 - 3
'53'and'2'
Explanation
If one operand of + is a string, concatenation happens. Other arithmetic operators convert operands to numbers. That's why values from input.value are converted with Number() before adding.