* Gets the last element of `array`. * * @static * @memberOf _ * @category Array * @param {Array} array The array to query. * @returns {*} Returns the last element of `array`. * @example * * _.last([1, 2, 3]); * // => 3
(array)
| 6620 | * // => 3 |
| 6621 | */ |
| 6622 | function last(array) { |
| 6623 | var length = array ? array.length : 0; |
| 6624 | return length ? array[length - 1] : undefined; |
| 6625 | } |
| 6626 | |
| 6627 | /** |
| 6628 | * This method is like `_.indexOf` except that it iterates over elements of |
no outgoing calls
no test coverage detected