title: Reference last element of an array in Javascript?
body: <p>In my code, I have a lot code like this:</p>
  
  <pre><code>my_array[my_array.length - 1] = sth;
  </code></pre>
  
  <p>Is it possible to define a simple variable to point to last element of array?like this:</p>
  
  <pre><code>var ref =  (&amp;|*, sth like that) my_array[my_array.length - 1];
  ref = sth;
  </code></pre>