var myArray = [
“Frank”,
“Paul”,
“Peter”,
“Adam”
];
// Adds Carl to start of array
myArray.unShift(”Carl”);
These methods allow us complete control over our array at any point onwards from its creation. These methods can be joined together to perform complex actions and manipulations on our arrays. There is no end to the possible combinations you could use to maintain your arrays. For example, you might want to sort the array alphabetically, and finally return the last item in the array before removing it. This complex action could be written in one single statement by chaining these powerful methods together. Let’s see this in action before we move on.