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
const fruits = ["Apple", "Orange", "Grapes"]
fruits.pop()
console.log(fruits) // Apple, Orange