I have an array ${myarr[@]} with strings. ${myarr[@]} basically consists of lines and each line constists of words.
${myarr[@]}
world hello moo
Alternative (without loop):
grep -o hello <<< ${myarr[*]} | wc -l