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
Most browsers will return an int starting at 1 and incrementing for each call of setTimeout so in theory it could never be 0.
But keep in mind that this is not really a requirement of the spec, just a convention browsers tend to follow. See the accepted answer here for more details: setInterval/setTimeout return value