Sha256: e3d0d744f11ebcd7eba5f7c675aa995162e8b228c9e216da0496eda74b026ef6
Contents?: true
Size: 415 Bytes
Versions: 301
Compression:
Stored size: 415 Bytes
Contents
/** * Gets the first element of `array`. * * @static * @memberOf _ * @since 0.1.0 * @alias first * @category Array * @param {Array} array The array to query. * @returns {*} Returns the first element of `array`. * @example * * _.head([1, 2, 3]); * // => 1 * * _.head([]); * // => undefined */ function head(array) { return (array && array.length) ? array[0] : undefined; } module.exports = head;
Version data entries
301 entries across 278 versions & 33 rubygems