title: I am confused with javascript let and var in for loop?
body: <p>Here is my code for loop</p>
  
  <pre><code>var username = ['Sam', 'Adarsh', 'Rohit', 'Rajat'];
  for(var i in username){
    console.log(username[i]);
  }
  </code></pre>
  
  <p>it's outputing the same as needed, But I am not sure why Let declaration needed. I understand the concept of VAR and LET but not sure in which cases var create problem in for loops ?</p>
  
  <p>Any body please help me to understant the concept. I am new noob and trying to figure out :)</p>
  
  <p>Thanks for your help.</p>