Using JavaScript last element of Array can be removed by setting the array length - 1.
var arr = [1, 2, 3, 4, 5, 6];
arr.length = ar.length - 1; // remove last element from array
console.log( arr ); // [1, 2, 3, 4]
Following code will remove first element from array
var arr = [1, 2, 3, 4, 5, 6];
//splice(startFromindex)
//splice(startFromindex, deleteCount)
let startFromindex = 0;
let deleteCount = 1;
arr.splice(startFromindex, deleteCount );
console.log( arr ); //[2, 3, 4, 5, 6]
Following code will remove second element from array
var arr = [1, 2, 3, 4, 5, 6];
//splice(startFromindex)
//splice(startFromindex, deleteCount)
let startFromindex = 0;
let deleteCount = 1;
arr.splice(startFromindex, deleteCount );
console.log( arr ); //[1, 3, 4, 5, 6]