javascript delete las element array code example
Example 1: js array delete last
array.pop()
Example 2: javascript delete second last element of array
arr.splice(arr.length - 2, 1);
array.pop()
arr.splice(arr.length - 2, 1);