title: How to exit (escape) a function from for loop inside of it?
body: <p>This is theoretical question to understand how many escapes (return or exit) can apply to nested loops or other controls and functions.</p>
  
  <p>I confused about this because I am stuck in the code 
  <a href="https://stackoverflow.com/questions/15574121/how-to-escape-from-for-each-loop-and-method-at-the-same-time">How to escape from for ... each loop and method at the same time?</a></p>
  
  <p>I can't stop iterating over <code>option</code>s in <code>select</code> element.</p>
  
  <p>I tried <code>return</code> and <code>return false</code> already, but am unsuccesful.</p>
  
  <p>Generally how we can do that?</p>
  
  <pre><code>function() {
      for (...) {
          if (...) {
              $(...).each(function() {
                 // You have to exit outer function from here
              });
          }
      }
  }
  </code></pre>