Why is that better? typeof is much faster, and avoids accessing the value. I'll change it if you want, but I don't see what it adds.