1var colors=["red","green","blue","yellow"];
2//loop back-words through array when removing items like so:
3for (var i = colors.length - 1; i >= 0; i--) {
4 if (colors[i] === "green" || colors[i] === "blue") {
5 colors.splice(i, 1);
6 }
7}
8//colors is now  ["red", "yellow"]