Javascript - Array class reference

Introduction

Array object can store multiple values in a single variable:

Array indexes are zero-based: the first element in the array is at index 0, the second is 1, and so on.

Property

PropertyDescription
Array length PropertyThe length property sets or returns the number of elements in an array.

Method

MethodDescription
Array concat() MethodThe concat() method is used to combine two or more arrays together.
Array constructor PropertyIn JavaScript, the constructor property returns the constructor function for an object.
Array copyWithin() MethodThe copyWithin() method copies array elements within the array, to and from specified positions.
Array entries() MethodThe entries() method returns an Array Iterator object with key/value pairs.
Array every() MethodThe every() method checks if all elements in an array pass a test.
Array fill() MethodThe fill() method fills all the elements in an array with a static value.
Array filter() MethodThe filter() method creates an array filled with all array elements that pass a test.
Array find() MethodThe find() method returns the value of the first element in an array that pass a test.
Array findIndex() MethodThe findIndex() method returns the index of the first element in an array that pass a test.
Array forEach() MethodThe forEach() method calls a provided function once for each element in an array.
Array from() MethodThe Array.from() method returns an Array object from object with a length property or an iterable object.
Array includes() methodYou can check if an element exists in an Array using this method.
Array indexOf() MethodThe indexOf() method searches the array for the specified item, and returns its position.
Array isArray() FunctionThe isArray() method determines whether an object is an array.
Array join() MethodThe join() method joins the elements of an array into a string, and returns the string.
Array keys() MethodThe keys() method returns an Array Iterator with the keys of an array.
Array lastIndexOf() MethodThe lastIndexOf() method searches the array for the specified item, and returns its position.
Array map() MethodThe map() method returns a new array with the elements being processed by a function for every array element.
Array of() methodArray.of() creates an array of elements more easily.
Array pop() MethodThe pop() method removes the last element of an array, and returns that element.
Array prototype PropertyThe prototype property allows you to add new properties and methods to the Array() object.
Array push() MethodThe push() method adds new items to the end of an array, and returns the new length.
Array reduce() MethodThe reduce() method will reduce the array to a single value.
Array reduceRight() MethodThe reduceRight() method reduces the array to a single value from position of length-1 to 0.
Array reverse() MethodThe reverse() method reverses the order of the elements in an array.
Array shift() MethodThe shift() method removes the first item from an array.
Array slice() MethodThe slice() method returns the sub-array elements in an array as a new array object.
Array some() MethodThe some() method checks if any of the elements in an array pass a test.
Array sort() MethodThe sort() method sorts the array items.
Array splice() MethodThe splice() method can add items to an array.
Array toString() MethodThe toString() method returns an array as a String.
Array unshift() MethodThe unshift() method adds new items to the beginning of an array, and returns the new length.
Array valueOf() MethodThe valueOf() method returns the array.