If you don't need to distinguish between different objects, using `typeof` is the prefered way to do it. I do not see any reason to use another method.
– henrikmerlanderMar 16 '16 at 07:58
1
They do very different things. So if you don't tell us what you need (why you need to check variable types, in what use case?) we can't tell you which one to choose. In terms of performance, no type check is always the best.
– BergiMar 16 '16 at 08:03