Sometimes it is really useful to know the datatypes, especially when it comes to iterating arguments passed to a function or accepting one argument of variable types, as we are going to see in some practical examples to come.
Detecting data types can be performed with typeof which can tell us if the data is a: boolean, number, string, function or object. Not very precise if you ask me. And there a number of cases where typeof fails, for instance if we initialize string object new String() it will return type object, or typeof  returns object too. So we need to fall back to some other method where typeof fails, we can detect object types with instanceof or we can fall back to the good old-fashioned duck typing, looking for the special object properties, like specific functions or length property and deciding what type it is.
As the good man Juriy Zaytsev, otherwise known as “kangax”, describes on his blog http://perfectionkills.com/instanceof-considered-harmful-or-how-to-write-a-robust-isarray/
Anyway we have to choose a way to detect type and I went with duck typing, which is not very professional, but it does it’s job as long as you don’t pass objects with the same combination of properties.
I agree that this is far from a perfect solution but it is a start. With the method whatis we expended the set of types to: boolean, float, int, string, array, date, function and object which was enough for my personal needs. The provided methods are sugar methods for a method is that is used to assert the type.
If you have any suggestions or improvements please leave a comment. I would appreciate any constructive criticism! :)