title: Why is my for loop printing so many results?
body: <p>I am learning about <code>for</code> loops. Here is my code:</p>
  <pre class="lang-bash prettyprint-override"><code>#!/bin/bash
  
  # states list
  
  states=('New York' 'Arizona' 'Texas')
  
  # script to check which state is cool. 
  
  for state in ${states[@]}
  do
      if [ $state = 'New York' ]
      then
          echo 'New York is cool' 
      else
          echo 'Arizona rocks'
      fi
  done
  </code></pre>
  <p>This is my output when I run it:</p>
  <pre class="lang-none prettyprint-override"><code>Arizona rocks
  Arizona rocks
  Arizona rocks
  Arizona rocks
  </code></pre>
  <p>Why is it outputting 4 times and also the wrong answer?</p>