- The pop() method removes the last element in the array
- The push() method adds one or more elements to the end of the array.
- The shift() method deletes the first element in the array.
- The unshift() method adds one or more elements to the beginning of the array.
- contact() concatenates two arrays
- The join() method splices the array into a string and returns the string
- The includes() method, whether the array contains a specified element, returns true if it does, otherwise returns false
- indexOf() method, returns the index number of the first occurrence of the specified element in the array, if not, returns -1 (commonly used to determine whether the array contains an element)
- The reverse() method reverses the order of the array.
- .sort() sorts according to the original algorithm, converts the array into a string, and then sorts in UTF-16
- splice() method. Arrays can be deleted, replaced, added
JavaScript - Summary of Common Methods for Arrays
Guess you like
Origin blog.csdn.net/qq_50487248/article/details/132070708
Recommended
Ranking