title: Break statement in javascript array map method
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2641347/how-to-short-circuit-array-foreach-like-calling-break">How to short circuit Array.forEach like calling break?</a>  </p>
  </blockquote>
  
  
  
  <p>Is there a way so that I can break out of array map method after my condition is met ? I tried the following which throws <code>"Illegal Break Statement" Error.</code> This is some random example I came up with.</p>
  
  <pre><code>var myArray = [22,34,5,67,99,0];
  
  var hasValueLessThanTen = false;
  
  myArray.map(function (value){
      if(value&lt;10){
        hasValueLessThanTen = true;
        break;
      }
    }
  );
  </code></pre>
  
  <p>We can do using <code>for</code> loops, but I wanted to know whether we can accomplish the same using <code>map</code> method ?</p>