JavaScript – Array.prototype Property
The Array.prototype property allows new properties and methods to be added to existing arrays.
The Array.prototype property allows new properties and methods to be added to existing arrays.
The Array push() method adds new items to the end of an array, changing the length of the array.
The reduce() method executes a reducer function for every array item, returning a single value representing the function’s accumulated result.
The Array reduceRight() method executes a reducer function for every array item, working from right to left, returning a single value.
The Array reverse() method reverses the order of the items in an array, overwriting the original array.
The Array shift() method removes and returns the first element of an array, changing the original array.
The Array slice() method returns selected elements in an array as a new array, without changing the original array.
The Array some() method checks if any array elements pass a test by executing a callback function for each array element.
The Array sort() method sorts the elements of an array as strings in alphabetical and ascending order, overwriting the original array.
The Array splice() method adds and/or removes array elements, overwriting the original array.
The Array toString() method returns a string with array values separated by commas, and does not change the original array.
The Array unshift() method adds new elements to the beginning of an array, overwriting the original array.
The Array valueOf() method returns the value of the array (contents), and does not change the original array.