constructor
constructor 属性返回 Object 的构造函数
const o = {}
o.constructor === Object // true
const a = []
a.constructor === Array // true
const n = new Number(3)
n.constructor === Number // true
instanceof
用于检测构造函数的 prototype 属性
是否出现在某个实例对象的原型链上。
实例对象的原型链上, 构造函数的 prototype 属性
实例对象是不是由某个构造函数,构造出来的
[] instanceof Object
true
[] instanceof Array
true
({}) instanceof Array
false