remove last element array jquery code example
Example 1: javascript remove last element from array
var colors = ["red","blue","green"];
colors.pop();
Example 2: javascript delete second last element of array
arr.splice(arr.length - 2, 1);
var colors = ["red","blue","green"];
colors.pop();
arr.splice(arr.length - 2, 1);