title: Why doesn't my 'for' statement loop and the if statement inside it execute?
body: <p>I have a function that has a for statement that repeats until a variable (i) is equal to <code>localStorage.length</code> and inside the for loop there is an if statement that checks if a localStorage entry starts with a # then runs a function. When I call this function nothing that is in the for loop runs.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function refresh() {
    var i = 0;
  
    console.info("The LocalStorage Length is: " + localStorage.length);
    console.info("i is: " + i);
    console.log("i == localStorage.length is:" + i == localStorage.length);
  
    for (i = 0; i == localStorage.length; i++) {
      console.info("i is: " + i);
  
      current = localStorage.key(i);
      if (current.substr(0, 1) == "#") {
        noteArea.innerHTML = +createHtml(current.substr(1), localStorage.getItem(current)); //Adds the html to the page
        console.log(current.substr(1) + " - Note displayed."); //Logs the note title
      } else {
        console.log("No notes saved.");
      }
  
      console.info("i == localStorage.length is:" + i == localStorage.length);
    }
  }
  
  
  function createHtml(name, desc) {
    var html = "&lt;div class = 'note'&gt; &lt;h4 class = 'note-title'&gt;" + name + "&lt;/h5&gt; &lt;p class = 'note-desc'&gt;" + desc + "&lt;/p&gt; &lt;/div&gt; &lt;br/&gt;";
  
    console.log(html);
    return html;
  }</code></pre>
  </div>
  </div>
  </p>