“Appearances can be deceiving Mr. Anderson” – a.k.a. short code is not always fast code

I used to take pride in my short, bulletproof and elegant String and Number type checks: // Check whether obj is a Number obj + 0 === obj // Check whether obj is a String obj + ” === obj I always thought that apart from being short and elegant, they should be faster. However, […]