Yes. I generally favor your way. I don't know why I wrote it explicitly. Since it is performing a type-sensitive (===) comparison instead of an type-coercive comparison (==), it could be argued that it performs better as written. I saw a test on jsperf.com a long time ago that addressed this and showed that === was usually much faster. Performance aside, I don't like how it is written now and I will revert the code to the more idiomatic style you suggest.