title: javascript exiting for loop without returning
body: <p>I have a for loop that I want to exit like this:</p>
  
  <pre><code>function MyFunction() {
    for (var i = 0; i &lt; SomeCondition; i++) {
       if (i === SomeOtherCondition) {
          // Do some work here.
          return false;
       }
    }
    // Execute the following code after breaking out of the for loop above.
    SomeOtherFunction();
  }
  </code></pre>
  
  <p>The problem is that after the <code>// Do some work here.</code> statements executes, I want to exit the for loop but still want to execute the code below the whole for loop (everything below <code>// Execute the following code after breaking out of the for loop above.</code>).</p>
  
  <p>The <code>return false</code> statement does exit the for loop but it also exits the whole function. How do I fix this?</p>