how to drop last 5 values of an array in javascript code example
Example 1: javascript delete second last element of array
arr.splice(arr.length - 2, 1);
Example 2: javascript array remove last
// example (remove the last element in the array)
let yourArray = ["aaa", "bbb", "ccc", "ddd"];
yourArray.pop(); // yourArray = ["aaa", "bbb", "ccc"]
// syntax:
// <array-name>.pop();