Howdy, Truck35.
The problem boils down to the conditions in the
if and
while statements. Let's look at the
if statement:
Code:
// original
if (isNaN(a||b||c)==true)
It's understandable why you wrote it this way. It reflects how we think as normal people: "If a, b, or c is not a number..." But programmers have to think in a different way: "If a is not a number, or b is not a number, or c is not a number...". That translates to the following in code:
Code:
// better
if (isNaN(a) == true || isNaN(b) == true || isNaN(c) == true)
But this code still needs work because it compares a boolean value with another boolean value--which is unnecessary in JavaScript (and most other languages). So the above could be rewritten as:
Code:
// correct
if (isNaN(a) || isNaN(b) || isNaN(c))
I'll let you apply this concept to the
while statement. I'm here if you need help.