instanceOf is free for typeOf , which are internal functions of MooTools that perform type traversal better than their native counterparts.
typeOf is a little more useful in this:
typeof []; // object typeOf([]); // array typeof new Date(); // object typeOf(new Date()); // date
instanceOf is mainly used for the class, although it also works for type constructors.
eg.
var foo = new Class(), bar = new Class({ Extends: foo }); var foobar = new bar(); instanceOf(foobar, bar); // true // but also due to Extends prototype chain and the constructor: instanceOf(foobar, foo); // true // as well as standard behaviour like instanceOf([], Array); // true instanceOf(4, Number); // true vs 4 instanceof Number == false
see source: https://github.com/mootools/mootools-core/blob/master/Source/Core/Core.js#L47-58
you may notice that many type constructors in mootools decorate objects to facilitate duck typing, so typeOf and instanceOf work with actual meaningful results.
also read a function like mootools
source share