remove the last element of array but keep the original array javascritpt code example
Example 1: splice last element from array javascript
array.splice(-1,1)
Example 2: javascript delete second last element of array
arr.splice(arr.length - 2, 1);