title: How to break out of .each() and return a value for a function
body: <p>I want to use <code>return false</code> to break a .each() but also return a value at the same time. How can I do this?</p>
  
  <p>Please refer to a work-around function to see what I am trying to do:</p>
  
  <pre><code>function HasStores(state) {
      var statehasstores = false;
  
      $(stores).each(function (index, store) {
          if (state == store.state &amp;&amp; store.category == "meyers") {
              statehasstores = true;
              return false;  // break
          }
      });
  
      return statehasstores;
  }
  </code></pre>
  
  <p>What Id like to do in pseudo code is:</p>
  
  <pre><code>Function () {
      for() {
          if found {
              return true;
          }   
      }
      return false;
  }
  </code></pre>