Javascript `typeof` issues and what to do about them
· ☕ 2 min read
typeof is useful but has inherent issues. There are gaps between what a developer expects in terms of consistency and what typeof delivers.
Let us look at a few examples -
1 2 const i = 1; console.log(typeof i); // number typeof is a unary operator, and does not require brackets.