JavaScript Array Functions Cheat Sheet Part 4
reverse()
reverse() array function reverses an array
Syntax
Example
shift()
shift() removes the first element from an array and returns that element
Syntax
Example
slice()
slice() returns a copy of part of the array, while the original array is not modified
Syntax
Example
some()
some() tests whether at least one element in the array passes the test
Syntax
Example
sort()
sort() sorts the elements of array in place
Syntax
Example
splice()
splice() changes contents of an array by removing, replacing and/or adding elements
Syntax
Example
toLocaleString()
toLocaleString() elements are converted to Strings using toLocaleString and are separated by locale-specific String (eg. “,”)
Syntax
Example
toString()
toString() returns a string representing the specified array
Syntax
Example
unshift()
unshift() adds one or more elements to the beginning of the array and returns the new length
Syntax
Example
values()
values() returns Array Iterator object that contains values for each index in array
Syntax
Example
Thanks for reading... 👏👏👏
0 Comments
If you have any question please ask?