Copyright © tutorialspoint.com

Javascript Array constructor Property

previous next

Advertisements


Description:

Javascript array constructor property returns a reference to the array function that created the instance's prototype.

Syntax:

array.constructor

Here is the detail of parameters:

Return Value:

Returns the function that created this object's instance.

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>

This will produce following result:

arr.constructor is: function Array() { [native code] } 

To understand it in better way you can Try it yourself.


previous next

Copyright © tutorialspoint.com