Use Array#indexOf instead of for loop to determine presence.