how to remove the last item of an array in javascript code example Example: javascript remove last element from array var colors = ["red","blue","green"]; colors.pop();