Bulletproof type checks in JavaScript
Using typeof
To check what type is a variable you would most likely use the typeof function. You can even skip the parenthesis (typeof someVariable is same as typeof(someVariable)).
typeof works great for:
strings
numbers (not if checking integer vs...
danielcobo.com3 min read