An advanced type-check function that returns accurate object types, unlike native typeof
xtag.typeOf(UNKNOWN_OBJECT)
xtag.typeOf(UNKNOWN_OBJECT)
Arguments | Type | |
---|---|---|
UNKNOWN_OBJECT | Object | Any valid JavaScript or DOM object |
xtag.typeOf(document) // returns "htmldocument"
typeof document // returns "object"
xtag.typeOf(document.body.children) // returns "htmlcollection"
typeof document.body.children // returns "object"
xtag.typeOf(/foo/) // returns "regexp"
typeof /foo/ // returns "object"