Computer >> Computer tutorials >  >> Programming >> Javascript

What are the methods 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.

Here is a list of some of the methods of the Array object:

S.NoMethod & Description
       1concat()

Returns a new array comprised of this array joined with other array(s) and/or value(s).
        2every()

Returns true if every element in this array satisfies the provided testing function.
        3filter()

Creates a new array with all of the elements of this array for which the provided filtering function returns true.
        4forEach()

Calls a function for each element in the array.
         5indexOf()

Returns the first (least) index of an element within the array equal to the specified value, or -1 if none is found.
         6join()

Joins all elements of an array into a string.