* Gets the first element of `array`. * * @static * @memberOf _ * @alias head * @category Array * @param {Array} array The array to query. * @returns {*} Returns the first element of `array`. * @example * * _.first([1, 2, 3]); * // => 1 *
(array)
| 6428 | * // => undefined |
| 6429 | */ |
| 6430 | function first(array) { |
| 6431 | return array ? array[0] : undefined; |
| 6432 | } |
| 6433 | |
| 6434 | /** |
| 6435 | * Flattens a nested array. If `isDeep` is `true` the array is recursively |
no outgoing calls
no test coverage detected