title: how to create a cookie array and reverse it
body: <p>I would like to get a cookies value by its key rather than name but the first key gives me the last cookie and the second = gets the second from last etc etc. so I reversed the array. so why is it not working? </p>
  
  <pre><code>function getByKey(key){ 
   var cookies = document.cookie.split(";");
      var rev = cookies.reverse();
      return rev[key];
  }
  getByKey(2);
  </code></pre>
  
  <p><a href="http://codepen.io/tarranjones/pen/FIzlt" rel="nofollow">http://codepen.io/tarranjones/pen/FIzlt</a></p>
  
  <p>any ideas.</p>