title: JavaScript selecting Object Arraylike?
body: <p>The Problem is the following:
  I have a JSON file that has objects with the following name: <code>"item0": { ... }, "item1": { ... }, "item2": { ... }</code>. But I can't access them when going through an if method.</p>
  
  <p>What I've done so far: </p>
  
  <pre><code>$.getJSON('/assets/storage/items.json', function(data) {
      jsonStringify = JSON.stringify(data);
      jsonFile = JSON.parse(jsonStringify);
  
      addItems();
  });
  
  var addItems = function() {
      /* var declarations */
  
      for (var i = 0; i &lt; Object.keys(jsonFile).length; i++) {
          path = 'jsonFile.item' + i;
          name = path.name;
          console.log(path.name);
          console.log(path.type);
      }
  
  }
  </code></pre>
  
  <p>If I console.log path.name it returns undefined. But if I enter jsonFile.item0.name it returns the value. So how can I use the string path so that it's treated like an object, or is there an other way on how to name the json items.</p>