Welcome to the Treehouse Community
Looking to learn something new?
Why would you need to know if a variable is known or not? Is it for debugging code? What does typeof do?
Richard Duncan5,568 Points
typeof returns a string value indicating the type of the object whose type is to be returned. In plain terminology it will evaluate the type of variable and return a string containing the data type stored in that variable.
It's very useful when you're writing functions that have arguments where you would like to set a default value. If the function is called with no parameters set for the arguments then you can check the typeof with an if statement, check to see if the arguments are say undefined and if they are assign default values to the variable.
There is more information on typeof here