A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/javascript-array-constructor-property/ below:

JavaScript Array constructor Property - GeeksforGeeks

JavaScript Array constructor Property

Last Updated : 11 Jul, 2025

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:

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();

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: 



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4