Anyone starting a new project and care about code quality, does not like adding a lot of utility third-party libraries, or anyone trying to build their library, for them below function will help in most of their conditional statements.
typeOf() function will never fail and can be kept as one of the foundational utility functions on your projects.
But hang on a second, what about other primitive types like
Float? Sure they are valid data types in other languages. Many of us may still remember your school teacher teaching them as data types. Where are they in the above code? Why just
Number datatype to define all types of numbers?
Let's cover that on a different post. Link below.