title: Best way to store this data (array, object, etc)
body: <p>I need to store (many) objects or arrays of data, which need to have the following criteria:</p>
  
  <p>I need to be able to add a new set of data into the existing data easily</p>
  
  <p>I need to be able to sort the data by date/ time added easily (array in order of when entries were pushed to it)</p>
  
  <p>I need to be able to grab an entry easily using a reference, either integer or string. This is important, at the moment I have to do an $.each() to loop through my data until I find the entry I want.</p>
  
  <p>I have tried using a structure like:</p>
  
  <pre><code>saved_info = {
      1001: {//all my data for ref 1001},
      1002: {//all my data for ref 1002}
  }
  </code></pre>
  
  <p>which gave me what wanted of being able to grab the info easily given a reference:</p>
  
  <pre><code>info = saved_info[1001];
  </code></pre>
  
  <p>however, the reference numbers I use aren't in order - I use a reference given to me (its a unique identifier), therefore the object isn't in order of when items were added/saved/pushed.</p>