What are the methods of an array object in JavaScript?

JavascriptWeb DevelopmentFront End Technology

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.No
Method & Description
       1
concat()

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

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

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

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

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

Joins all elements of an array into a string.
raja
Published on 22-Apr-2018 18:02:26
Advertisements