title: Why is Data Null?
body: <p>I came across an error today, and I am not sure why it occurred. At the second for loop, the access to data will be undefined instead of the data that was inserted as a parameter into the function. Somehow the data gets the value of null, instead of the Object that was passed to this function. Does anyone know why? The error I get is "data is not defined".</p>
  
  <pre><code>     createDataObject: function (data) {
          let dataObj = data.source[0];
          let backedData = data.backedData;
          for (let i in dataObj) {
              let d = dataObj[i];
              d.data = { source: d.data };
          }
          for (let i = 0; i &lt; data.backedData.length; i++) {
              let bd = data.backedData[i];      //&lt;- this is where the error occurrs
              let data = bd.data[0];
          }
  }
  </code></pre>
  
  <p>Here is some code outside of the object, if you want to try, that I was using, this will work on your console or in node. Seems like I have come across a Javascript compiler bug. I am not sure.</p>
  
  <pre><code>createDataObject({source: [[{data: 1}]],  backedData: [1,2,3, 4]});
  </code></pre>
  
  <p>The code above will work if I do the following</p>
  
  <pre><code>    createDataObject: function (data) {
          let dataObj = data.source[0];
          let backedData = data.backedData;   //create the backedData variable here
          for (let i in dataObj) {
              let d = dataObj[i];
              d.data = { source: d.data };
          }
          for (let i = 0; i &lt; backedData.length; i++) {
              let bd = backedData[i]; // no Error
              let data = bd.data[0];
              //.....
          }
      }
  </code></pre>