+ 5

Why my number is converted into string in JavaScript

I want to know why my code is not working properly instead of adding they showing the numbers ? https://code.sololearn.com/W6vheWg1326o/?ref=app

28th Jul 2017, 9:32 AM
Rahul Roy
Rahul Roy - avatar
3 Answers
28th Jul 2017, 10:21 AM
Biser Z Ivanov
Biser Z Ivanov - avatar
+ 5
Thanks for your answer
28th Jul 2017, 10:28 AM
Rahul Roy
Rahul Roy - avatar
+ 1
you got string value. try convert input to number with unary operator +prompt1 and +prompt2
28th Jul 2017, 11:46 AM
Вап