var myArray = [

“Frank”,

“Paul”,

“Peter”,

“Adam”

];

// This logs to the console “Frank, Paul, Peter, Adam”

console.log(myArray.join(”, “));

pop()

The pop method can be seen as the opposite to the push method; instead of adding an element to the end of an array, the pop method allows us to remove the last element from an array. As well as removing the element, the method also ‘returns’ the element that was removed, meaning that we are able to use the method to remove the last element, and then see exactly what that element was. Take a look at how powerful this can be below: