Let\'s say I have an array with many Strings Called \"birdBlue\", \"birdRed\" and some other animals like \"pig1\", \"pig2\"
\"birdBlue\"
\"birdRed\"
\"pig1\"
\"pig2\"
You should use RegExp (they are awesome) an easy solution is:
if( /^bird/.test(animals[i]) ){ // a bird :D }