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