What are the properties of an array object in JavaScript?



The Array object lets you store multiple values in a single variable. It stores a fixed-size sequential collection of elements of the same type.

The following is the list of the properties of the Array object −

Sr.No
Property & Description
1
constructor
Returns a reference to the array function that created the object.
2
index
The property represents the zero-based index of the match in the string.
3
input
This property is only present in arrays created by regular expression matches.
4
length
Reflects the number of elements in an array.
5
prototype
The prototype property allows you to add properties and methods to an object.

Example

Let’s see an example of the prototype property

Live Demo

    
         
      JavaScript Array Object              
                
       
                 
              
   

Output

Book title is : Java
Book author is : John
Book price is : 300
Updated on: 2020-06-19T13:18:59+05:30

5K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements