title: Order of the associative array in JavaScript by key and access by index
body: <p>I have an associative array like:</p>
  <pre><code>var arr = {};
  arr['alz'] = '15a';
  arr['aly'] = '16b';
  arr['alx'] = '17a';
  arr['alw'] = '09c';
  </code></pre>
  <p>I need to find the previous and next key of any selected element. Say, for key 'aly' it will be 'alz' and 'alx'. If possible, I want to access the array by index rather than the key.</p>
  <p>Currently, I am doing this using a separate array containing keys, e.g.</p>
  <pre><code>var arrkeys = ['alz','aly','alx','alw'];
  </code></pre>