请问为啥我算a=12,b=12,sum=a+b;结果sum是1212????
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>check</title>
<script>
function add2(a,b){
var sum=a+b;
var diff=a-b;
document.write("两数之和为:"+sum);
document.write("两数之差为:"+diff);
}
function calculate()
{
var a=prompt("请输入数字");
var b=prompt("请输入第二个数字");
add2(a,b);
}
</script>
</head>
<body>
<button onclick="calculate()">点我算数</button>
</body>
</html>