Javascript Array constructor

In this tutorial, we will learn about the JavaScript Array constructor property with the help of examples.

The constructor property returns the constructor function for the array.


let languages = ["JavaScript", "Java", "Python"];

let constructor = languages.constructor;

// Output:
// [Function: Array]

constructor Syntax

The syntax to access the constructor property is:


Here, arr is an array.

constructor Parameters

The constructor is a property in JavaScript, so it doesn't take any parameters.

constructor Return Value

  • Returns the constructor function for the array.

For JavaScript arrays, the constructor property returns function Array() { [native code] }.

Note: The return value is a reference to the function, not the name of the function.

Example : Using constructor property

let array = [1, 2, 3, 4, 5];

let constructor = array.constructor;



[Function: Array]

Recommended Reading: JavaScript Constructor Function

Did you find this article helpful?