typeofit is actually an operator, not a function, it returns the type of the operand provided to you and always returns [1] a string value, which can be:
"undefined""object""boolean""number""string""function"
It may look like a function because it can be applied to expressions in brackets, but brackets are optional, you can use it without them:
typeof expression
, , ( , , ), ReferenceError, "undefined", :
if (typeof imUndeclared == 'undefined') {
}
if (imUndeclared === undefined) {
}
, , , typeof "object" null, ...
, Array , RegExp, Date .., , .
[1] JScript (IE):), "unknown"!!! -, . typeof new ActiveXObject("Msxml2.XMLHTTP").abort; // "unknown"