嘗試使用功能,在JavaScript中添加三個數字,但它不是增加他們,而不是它只是寫他們作爲一個數量嘗試使用功能,在JavaScript中添加三個數字,但它不是增加他們,而不是它只是寫他們作爲一個數量
function numinput(a,b,c,res){
a = prompt("Enter first number");
b = prompt("Enter second number");
c = prompt("Enter third number");
res = a + b + c ;
alert (res);
}
numinput();
的可能的複製[使用Javascript級聯數字,而不是增加了( HTTP://計算器。com/questions/14656003/javascript-concatenating-numbers-not-add-up) – legoscia