+ 4
Oh wait. Wait. Wait. I got the problem.
Your numbers are not numbers (as in integers), they are strings!
+ 3
When numbers are inputted the program works fine.
What you have handled wrongly is the no input case.
If (num1)||(num2==NaN) is what your 3rd condition does. You need to do:
if (num1==NaN||num2==NaN)
+ 3
Jack Rehfeldt Look at my edited answer
+ 2
I remember one neat "hacks" which is simply,
add a +
Edit:
var prompt1 = +prompt("Hey");
var prompt2 = +prompt("There");
Like that