Searching Bash Arrays

Hi,

I am writing a bash shell script. I would like to execute a statement only if an array contains a specific value. For example:

array=(1 3 5 7)

I would like to execute the statement only if the value 3 is present in ${array}.

Thanks for any help,
Mike

#!/bin/sh

arr=(1 2 3 4)

len=${#arr[@]}
 
for(( i=1; i < $len; i++))
do
  if [ ${arr[$i]} -eq 2 ] ; then
    echo "exec some statement"
  fi
done

.Aaron