+ 3
What is this error with JavaScript
How can JavaScript consider addition in it ?! https://code.sololearn.com/W3z8Rwe40oSK/?ref=app
4 Answers
+ 5
Do this too:
var x=prompt("Enter the first Number");
var y=prompt("Enter the second Number");
document.write((+x + +y)+"<br>");
document.write(x*y)
+ 6
the problem is with line
document.write(x+y+"<br>");
because x and y are working as a string
try this 👇👇👇
x=parseInt(x);
y=parseInt(y);
and then
document.write((x+y)+"<br>");
+ 5
The + infront of the string is equivalent to the parseInt
0
@Mr. Programmer it says "parselnt" is not defined