获取js内置对象实例所属的类型

在js中,typeof js内置对象实例都会返回object。例如:

let value = [1,2,‘a‘];

typeof回返回object,而Object.prototype.toString.call(value)回返回[object Array],但是自定义对象实例仍然回返回object。对于自定义对象实例可以考虑使用实例原型中的constructor属性