0
What's wrong in this code?
Addition became concatenation https://code.sololearn.com/WiPC6QU1FcWA/?ref=app
5 Answers
+ 1
the return type of window.prompt it a string, that mean you should cast the value given to Number:
var a = Number(prompt("Enter first number:"));
var b = Number(prompt("Enter second number:"));
+ 4
Mohamed ELomari Seeing your problem was already resolved it would be great if you can mark the answer that you find useful to encourage the community to help each other out. đ
+ 1
Thank you for help. Casting Number worked correctly
0
use the '\n' for the newline character
0
Thanks. I have to use "<br />" instead