title: How to properly filtered keys object
body: <p>I have some objects stored in the localstorage and i want some of it to be ignored when i get the keys, i have an array to filter the keys i want to be ignored. Think of l here as the localstorage with the actual key/value, i want to ignore the <code>bglist</code> ,<code>username</code> and <code>visitedbefore</code> properties, i am trying to do that through looping. But only the <code>bglist</code> is being treated as filtered.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>  var l = {
        '1': [{ description: 'ga', set_title: 'name this reminder' }],
        bglist: [
          {
            author: 'Bildermeines',
            images: [
              './images/bildermeines/landscape-2130844.jpg',
              './images/bildermeines/milky-way-2076251.jpg',
              './images/bildermeines/nature-2484584.jpg',
              './images/bildermeines/port-2506025.jpg',
              './images/bildermeines/waterfall-2115206.jpg',
            ],
          },
          {
            author: 'Jez Timms',
            images: [
              './images/jeztimms/jez-timms-157465.jpg',
              './images/jeztimms/jez-timms-158151.jpg',
              './images/jeztimms/jez-timms-178355.jpg',
            ],
          },
          {
            author: 'Lubos Houska',
            images: [
              './images/luboshouska/city-1134141.jpg',
              './images/luboshouska/prague-1168302.jpg',
            ],
          },
          {
            author: 'oadtz',
            images: [
              './images/oadtz/bangkok-1897718.jpg',
              './images/oadtz/electricity-1835546.jpg',
              './images/oadtz/star-1908593.jpg',
            ],
          },
          {
            author: 'quangle',
            images: [
              './images/quangle/ham-ninh-1050828.jpg',
              './images/quangle/sunrise-1014711.jpg',
            ],
          },
          {
            author: 'skeeze',
            images: [
              './images/skeeze/eiffel-tower-1156146.jpg',
              './images/skeeze/monument-valley-1593318.jpg',
              './images/skeeze/mountains-2228259.jpg',
            ],
          },
        ],
        username: 'Disgusting',
        visitedbefore: false,
      };
      
      let filterArr = ['bglist', 'username', 'visitedbefore'];
      let keys = Object.keys(l),
        i = 0,
        key,
        array,
        filterItem = 0;
      
      for (; filterItem &lt; filterArr.length; filterItem++) {
        for (; (key = keys[i]); i++) {
          if (filterArr[filterItem] === key) {
            console.log(key + ' is filtered ' + filterArr[filterItem]);
          } else {
            console.log(key + ' is not filtered');
          }
        }
      }</code></pre>
  </div>
  </div>
  </p>
  
  <p>The following gives me an output</p>
  
  <pre><code>1 is not filtered
  bglist is filtered bglist
  username is not filtered
  visitedbefore is not filtered
  </code></pre>