目录

constructor

描述 (Description)

Javascript数组constructor属性返回对创建实例原型的数组函数的引用。

语法 (Syntax)

其语法如下 -

array.constructor

返回值 (Return Value)

返回创建此对象实例的函数。

例子 (Example)

请尝试以下示例。

<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>

输出 (Output)

arr.constructor is: function Array() { [native code] } 
↑回到顶部↑
WIKI教程 @2018