function Animal() {
}
function Cat() {
}
Cat.prototype = new Animal();
Cat.prototype.CatchMouse = function () {
//do some thing
}
var garfield = new Cat();
alert(garfield instanceof Cat); //true 毫无疑问
alert(garfield instanceof Animal); //true 可以理解
好了,关于javascript的数据类型检测,楼猪就大致总结介绍到这里了。希望有心的高人补充。
您可能感兴趣的文章: