0

I write a function and try to add two number on it, But when I use ' + ' operator between two operators it's concate them. On the other hand if I use '-' operator then no problem. How can I fix it ?

var a = prompt("Enter value of a : ");
var b = prompt("Enter value of b : ");

sum(a, b);

function sum(a, b){
    document.write("A + B = "+ (a+b) );   
}
Patrick Roberts
  • 49,224
  • 10
  • 102
  • 153
Shuvo3664
  • 791
  • 2
  • 8
  • 11

0 Answers0