2 * Gets the last element of `array`.
7 * @param {Array} array The array to query.
8 * @returns {*} Returns the last element of `array`.
14 function last(array) {
15 var length = array ? array.length : 0;
16 return length ? array[length - 1] : undefined;
19 module.exports = last;