title: How to get the last item of array without pop?
body: <p>I need the same result as:</p>
  
  <pre><code>var array = [1, 2, 3, 5, 7];
  var top = array.pop();
  </code></pre>
  
  <p>The problem is that <code>pop</code> removes the element from the array. To fix that I added another line:</p>
  
  <pre><code>array.push(top);
  </code></pre>
  
  <p>But it is annoying me, I did it four or five times in this project till now. Is there a better way?</p>