minor cleanup and corner cases illustrated...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2014-09-30 18:08:36 +04:00
parent c3d57ce9a8
commit e2c5bff393

View File

@ -385,6 +385,7 @@
: isInstanceOf(obj.__proto__, proto)))
}
isInstanceOf(c, C) // -> true
isInstanceOf(c, B) // -> true
isInstanceOf(c, A) // -> true
@ -395,6 +396,29 @@
// -> false
// Also take note of the following cases:
Object instanceof Function
// -> true
Function instanceof Object
// -> true
Object instanceof Object
// -> true
Function instanceof Function
// -> true
// Now, the fact that a function object is both a function and an object
// should be obvious:
function f(){}
f instanceof Function
// -> true
f instanceof Object
// -> true
// Checking type (typeof)
// ----------------------