JS的instanceof详解
instanceof 运算符用于检测构造函数的 prototype 属性是否出现在某个实例对象的原型链上,返回值为布尔值。
语法 : object instanceof constructo
参数
object:某个实例对象
constructor:某个构造函数
简单例子
function Car(make, model, year) {
this.make = make;
this.model = model;
this.year = year;
}
const auto = new