remove last element from array es6 splice code example
Example 1: javascript delete second last element of array
arr.splice(arr.length - 2, 1);
Example 2: javascript remove last element from array
var arr = [1,0,2];
arr.splice(arr.length - 2, 1);
var arr = [1,0,2];