Why not just use simple javascript?
var array=[1,2,3,4];
var lastEl = array[array.length-1];
You can write it as a method too, if you like (assuming prototype has not been included on your page):
Array.prototype.last = function() {return this[this.length-1];}