Remove an element at the end of the array.
Using length
Output = [1, 2, 3, 4, 5]
Using pop()
pop() method removes last element from an array and returns that elements.
Output = [1, 2, 3, 4, 5]
Using Splice()
Splice() method changes an array by removing or replacing existing elements and/or adding new elements in place.
Output = [1, 2, 3, 4, 5]