First: 0 isn't the same as null, (0 == null) would be false in every case';
if you want to test 'a' against something: define 'a' first and later assign the settimeout to 'a'. then check against the type of 'a'. If its 'undefined', the timer hasn't triggered yet