Type operators are not available in all programming languages.
Although they vary in how they are written between languages, the type operators are roughly as follows:
|typeof||typeof “John” returns “string”|
typeof 3.14 returns “number”
|Tells you what data type your variable is using. |
It returns this information in the form of a operand with a data type of string.
This can be useful for telling you if you have stored a number in a variable in a way that you can perform maths upon it (an integer) or not (a string).
|instanceof||instanceof jack-russel-terrier returns true (of the class dog)||Tells you if your object is an instance of something and returns true if it is, and false if it is not.|