You can use pop() method of array in Javascript to remove the last element from array.
Using pop() method of Array in Javascript:
var arr = [10, 20, 30, 40, 50, 60, 70]; arr.pop(); // returns 70 console.log( arr ); // [10, 20, 30, 40, 50, 60]
Ask Us