title: JS array apparently doesn't have a length
body: <p>Hi I have come across a strange JS/JQuery issue.</p>
  
  <p>I have 2 arrays which contain a timestamp and a value. I have merged these 2 arrays together so that if the timestamp is the same in both arrays create one array with the timestamp, value1 and value2. (value1 is in the first array, value2 is in the second array)</p>
  
  <p>Here is the code I have written to do this. <code>value[0]</code> is the timestamp</p>
  
  <pre><code>var combinedArray = [];
  $.each(data.new, function(key, value) {
      combinedArray[value[0]] = [value[0], value[1]];
  });
  
  $.each(data.repeat, function(key, value) {
      combinedArray[value[0]].push(value[1]);
  });
  </code></pre>
  
  <p>If I log this to the browser it looks like so:</p>
  
  <p><a href="https://i.stack.imgur.com/SQwoX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SQwoX.png" alt="Image"></a></p>
  
  <p>As you can see the <code>combinedArray</code> does have multiple values so I'm not sure why the length is 0.</p>
  
  <p>The reason this is an issue is because I need to loop over the <code>combinedArray</code> which I currently cannot do.</p>