how to remove the 1st and last index in an array javascript code example Example: splice last element from array javascript array.splice(-1,1)