.pop()

.pop()

  • Extracts the last element of the array and returns it

  • Like pop(), push() is also a mutating method because it changes the value of the original array


Example

const fruits = ["Apple", "Orange", "Grapes"]

fruits.pop()

console.log(fruits) // Apple, Orange

JS Bin on jsbin.com