JavaScript数组构造函数属性返回对创建原型的数组函数的引用。
array.constructor
返回创建此对象的函数。
<html> <head> <title>JavaScript Array constructor Property</title> </head> <body> <script type="text/javascript"> var arr=new Array( 10, 20, 30 ); document.write("arr.constructor is:" + arr.constructor); </script> </body> </html>
运行上面代码输出
arr.constructor is: function Array() { [native code] }
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)