Can setTimeout ever return 0 as the id?

Viewed 7071

I am writing a check to see if a timeout is active. I was thinking of doing this:

var a = setTimeout(fn, 10);
// ... Other code ... where clearTimeout(a) can be called and set to null
if (a != null)
{
   // do soemthing
}

I was wondering if it would ever be possible that a will be 0. In that case I would use a !== null

4 Answers
Related