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