title: Javascript for loop until - multiple conditions
body: <p>I am using javascript, using regex to scrape images from html code.</p>
  
  <p>I want the loop to run either until the script finds no more images or until it reaches 12.</p>
  
  <p>I'm trying the following but not working:</p>
  
  <pre><code>var imgs = d.getElementsByTagName('img'), found = [];
  for(var i=0,img; ((img = imgs[i]) || ( $i &lt; 13)); i++)
  </code></pre>
  
  <p>Is this possible? Am I on the right lines?</p>
  
  <p>Quite new to javascript but trying!</p>