JavaScript/Reserved words/typeof
< JavaScript | Reserved words
The typeof keywordEdit
The typeof keyword is a unary operator that returns a string giving the type of the parametre.
SyntaxEdit
typeof[(]expression[)];
The operator returns six values, which are boolean, function, number, object, string, and undefined.
ExamplesEdit
theArray = new Array();
if (typeof(theArray) == 'object') {
[…]
}