instanceof:检测一个对象是否为某个构造函数的实例
var str = new String('xiaoming');
console.log(str instanceof String);
console.log(str instanceof Object);
function Animal(){}
var dog = new Animal();
console.log(dog instanceof Animal());
isPrototypeOf:检测一个对象是否存在另一个对象的原型链上
function Dog(){}
var dog = new Dog();
console.log(Dog.prototype.isPrototypeOf(dog));//检测dog是否在Dog的原型链上
function Animal(){}
Dog.prototype = new Animal();//原型链继承