Thursday, September 4, 2025
HomeLanguagesJavascriptJavaScript Array constructor Property

JavaScript Array constructor Property

The JavaScript Array constructor property is used to return the constructor function for an array object. It only returns the reference of the function and does not return the name of the function. In JavaScript arrays, it returns the function Array(){ [native code] }.

Syntax:  

array.constructor

Return value:

It returns the function reference i.e. function Array() { [native code] }.

Below is an example of the Array constructor property. 

Example 1: In this example, the program returns the reference of the function (i.e. function Array() { [native code] } ).

Javascript




// Function to be executed
function myGeeks() {
    // Create array
    let name = ["sahil", "Manas",
        "Sagar", "Harshit"];
    // Display constructor property
    console.log(name.constructor);
}
myGeeks();


Output

[Function: Array]

Example 2: In this example, the program returns the reference of the function (i.e. function Array() { [native code] } ).

Javascript




// Create new array
let arr = new Array("Geeks", "for", "Geeks");
 
// Display constructor property
console.log("arr.constructor:" + arr.constructor);


Output

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

Example 3: In this example, the program returns the reference of the function (i.e. function Array() { [native code] } ).

Javascript




// Create array
let arr = new Array(5, 10, 15);
 
// Dislay constructor property
console.log("arr.constructor:" + arr.constructor);


Output

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

We have a complete list of Javascript Array methods, to check those please go through this Javascript Array Complete reference article.

Supported Browsers: The browsers supported by JavaScript Array constructor Property are listed below: 

  • Google Chrome
  • Edge
  • Firefox
  • Opera
  • Safari
RELATED ARTICLES

Most Popular

Dominic
32264 POSTS0 COMMENTS
Milvus
81 POSTS0 COMMENTS
Nango Kala
6628 POSTS0 COMMENTS
Nicole Veronica
11799 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11858 POSTS0 COMMENTS
Shaida Kate Naidoo
6749 POSTS0 COMMENTS
Ted Musemwa
7025 POSTS0 COMMENTS
Thapelo Manthata
6698 POSTS0 COMMENTS
Umr Jansen
6716 POSTS0 COMMENTS