title: Javascript - create array index and access
body: <p>I am looking to create a simple array using a time stamp for the index so that I can access the values by timestamp without iterating through the array, however I am struggling!</p>
  
  <p>I need to be able to set 2 values for each row.</p>
  
  <p>For example:</p>
  
  <pre><code>var myarray = [];
  var test1 = 'hello'
  var test2 = 'world'
  
  myarray[timestamp] = [test1, test2];
  </code></pre>
  
  <p>So for a given timestamp e.g. 12345678, how could I access the value of test2?</p>
  
  <p>Appreciate any thoughts and advice.</p>
  
  <p>Regards, Ben.</p>