Exerpad
Exercise 6 · Chapter: Linear ProgramsRequired+50 XP

Fix the Concatenation

This program should add the score and the bonus, but it prints Total: 105 instead of Total: 15. Fix it!

Expected output:

Total: 15

Hint: "10" + 5 glues text together and gives "105". Numbers only add up when both sides are numbers.

Need a hint?
3 available · costs 5 XP each
javascript
let score = "10";
let bonus = 5;
console.log("Total: " + (score + bonus));
Output
Run your code to see the output here.