Bulletproof type checks in JavaScript
May 17, 2021 · 3 min read · 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...
Join discussion




