js constructor typeOf 区别

constructor 属性返回对创建此对象的数组函数的引用。

例如:const obj = {a: 1}

        console.log(obj.constructor)   // function Object() { [native code] }

        console.log(obj.constructor === Object)  true

        console.log(obj.constructor === 'object')  false

        console.log(typeof obj)           // object 

        console.log(typeof obj === 'object')    true

        console.log(typeof obj === Object)    false

原文地址:https://www.cnblogs.com/gqx-html/p/11269557.html