I\'ve been trying to solve this problem for the last couple days: when I subtract, multiply or divide 2 numbers input through a prompt, everything works fine; but when I wan
You are using concatination operation instead of arithmetic operator.
In your above code:
alert(a + b);
Your browser compiler will assume it as concatination. So it concatinating two strings. That is why you are getting that output.