views:

70

answers:

3

What operator or expression can I use that will fire on every number, including zero?

I want a logic operator that will fire with ever number it receives. My animations pause at zero.

This skips on zero

if (numberThing> 0);

This jitters 'fires quickly and goes back on count'

if (numberThing== 0);

alt text

EXPLANATION
I'm catching split string values in a logic function, and feeding them to a series of IF, ELSE IF statements. I'm using this with a timer, so I can measure the discrepancy.

+1  A: 

you could do

if(numberThing >= 0)

or if they are all numbers anyway

if(true)

kind of strange that it wouldn't just run with no if statements, is there anywhere else this issue could be coming from?

Lowgain
The >= 0 seems correct, but it didn't work.
VideoDnd
is there a chance that the problem is somewhere else in the code?
Lowgain
+3  A: 
if(!isNaN(value))
quoo
I voted this up because it worked too, thanks (!isNaN(numberThing))
VideoDnd
+1  A: 

How about if (numberThing> 0 || numberThing === 0)?

Gabe
@Gabe, this worked. Also, if (numberThing> 0 || numberThing == 0)
VideoDnd