title: How to set more than one limit on for loop : javascript
body: <p>I am working with javascript arrays, here i am using for loop to get the top three results.(no .length limit)</p>
  
  <p>Attempting to have something like </p>
  
  <pre><code>for(let a=0;a&lt;usss.length || a&lt;3;a++)
  </code></pre>
  
  <p>Simple</p>
  
  <pre><code>var users = ['s','g','h','i'];
  for(let a=0;a&lt;3;a++){//dont want to use a &lt; users.length
     console.log(users[a]);
  }
  </code></pre>
  
  <p>problem</p>
  
  <pre><code>var users2 = ['s','g'];
  for(let a=0;a&lt;3;a++){
    console.log(users2[a]);
  }
  </code></pre>
  
  <p>The way around,</p>
  
  <pre><code>var users2 = ['s','g'];
  for(let a=0;a&lt;users2.length;a++){
   if(a&lt;3){
    console.log(users2[a]);
   }
  }
  </code></pre>
  
  <p><strong>Real Question</strong></p>
  
  <blockquote>
    <p>How can i avoid using extra if() condition in my last stated code?</p>
  </blockquote>
  
  <p>I am sorry if its very basic question, i just stuck on it.
  Any help or information will be appreciated. Thanks for your time.</p>