my while loop runs forever and I can't seem to solve the problem. I think the problem is with my while condition. Just need someone to take a look and see what is wrong.
thanks in advance
Code: Select all
var operator, num1, num2, answer;num1 = parseFloat(prompt("enter number 1", ""));num2 = parseFloat(prompt("enter number 2", ""));do{operator = prompt("enter a for addition, s for subtraction", "");}while(operator != "a" || operator != "s"); if(operator == "a"){ answer = num1 + num2;}else{ answer = num1 - num2;}document.write(answer);