Javascript has several built-in array methods that can be used to manipulate arrays. Here are some common methods and their uses:
.push()
- Adds elements to the end of an array.pop()
- Removes the last element of an array.unshift()
- Adds elements to the beginning of an array.shift()
- Removes the first element of an array.slice()
- Returns a shallow copy of a portion of an array.splice()
- Adds/Removes elements from an array.sort()
- Sorts the elements of an array.reverse()
- Reverses the order of elements in an array.concat()
- Joins two or more arrays into a new array.join()
- Joins all elements of an array into a string