how to delete the last item in an arrayt code example Example: splice last element from array javascript array.splice(-1,1)