array slice ignore last few elements code example Example: splice last element from array javascript array.splice(-1,1)