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.
This is a quick reference list of JavaScript array methods and properties with examples of how they are used.
The serializeArray() method creates an array of objects (name and value) by serializing form values.
The toArray() method returns the elements matched by the jQuery selector as an array.
The PHP array() function is used to create an array (indexed, associative, or multidimensional).
The PHP array_change_key_case() function changes all keys in an array to lowercase or uppercase.
The PHP array_chunk() function splits an array into chunks of new arrays.
The PHP array_column() function returns the values from a single column in the input array.