instanceof 检测一个对象是否是某个构造函数的实例(new)
isPrototypeOf() 检查一个对象是否存在于另一个对象的原型链上
//instanceof
var str = new String('zhangsan');
console.log(str instanceof String);//true
function Animal(){}
var dog1 = new Animal();//用new来调用的函数一般是构造函数
console.log(dog1 instanceof Animal)//true
//isPrototypeOf
console.log(Animal.prototype.isPrototypeOf(dog1))//true检测对象dog1是否在animal的原型链上
var obj = {};
console.log(Object.prototype.isPrototypeOf(obj));//true
function Dog(){}
var dog2 = new Dog();
console.log(Animal.prototype.isPrototypeOf(dog2));//false不在animal的原型链上
var obj = {};
console.log(Object.prototype.isPrototypeOf(obj)); //true