how to empty array in jquery code example Example: javascript empty array var colors = ["red","blue","green"]; colors = []; //empty the array