title: Convert array to object with saving original index field
body: <p>I have an array that is sorted in the following way</p>
  
  <pre><code>var items = [2.99, 5.99, 23.99, 1.99];
  items.sort(function(a,b) { return a - b;});
  </code></pre>
  
  <p>This outputs the following:</p>
  
  <pre><code>[1.99, 2.99, 5.99, 23.99]
  </code></pre>
  
  <p>But I need a way to sort it but keep an index of the original index, e.g.</p>
  
  <pre><code>[3: 1.99, 0: 2.99, 1: 5.99, 2:23.99]
  </code></pre>
  
  <p>Any help would be appreciated.</p>