1.constructor 属性返回对象的构造函数
<script>/*面试题:如何判断一个数组是不是数组 1.Array.isArray() 2.instanceof 3.constructor1.对象,类,原型,原型链*//*构造属性创造构造函数时,原型对象上会有一个constructor属性,它是原型对象所独有的*/function Person(name,age){this.name=name;this.age=age;}var p=new Person("cheng",20)console.log(p.constructor==Person); //truevar arr=[1,2,3];console.log(arr.constructor==Array); //true</script>
