<script type="text/javascript">
function calc(input1,input2){
return input1+input2;
}
qwer = prompt("a값 :");
asdf = prompt("b값 :");
document.write(calc(qwer,asdf));
</script>
위와 같은 코딩을 했는데
input1+input2에서 부호를 -로 고쳤을때는 뺄셈을
*으로 고쳤을때는 곱셈을
/으로 고쳤을때는 나눗셈을 하지만 +은 덧셈이 아니라 문자열 붙이는 것 밖에 안하더군요.
예를들어 input1 값을 1, input2 값을 2라고 하면
3이 아니라 12라고 출력이 되더군요...
덧셈을 하려면 어떻게 해야하나요?