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

Version Path
rapid_stack-0.1.1 templates/FrontEnd/node_modules/lodash/head.js
rapid_stack-0.1.0 templates/FrontEnd/node_modules/lodash/head.js
immosquare-cleaner-0.1.60 node_modules/lodash/head.js
immosquare-cleaner-0.1.59 node_modules/lodash/head.js
immosquare-cleaner-0.1.58 node_modules/lodash/head.js
immosquare-cleaner-0.1.57 node_modules/lodash/head.js
immosquare-cleaner-0.1.56 node_modules/lodash/head.js
immosquare-cleaner-0.1.55 node_modules/lodash/head.js
immosquare-cleaner-0.1.54 node_modules/lodash/head.js
immosquare-cleaner-0.1.53 node_modules/lodash/head.js
immosquare-cleaner-0.1.52 node_modules/lodash/head.js
trusty-cms-6.3.1 node_modules/lodash/head.js
immosquare-cleaner-0.1.51 node_modules/lodash/head.js
boring_generators-0.15.0 tmp/templates/app_template/node_modules/lodash/head.js
clapton-0.0.26 lib/clapton/javascripts/node_modules/lodash/head.js
clapton-0.0.25 lib/clapton/javascripts/node_modules/lodash/head.js
immosquare-cleaner-0.1.50 node_modules/lodash/head.js
clapton-0.0.24 lib/clapton/javascripts/node_modules/lodash/head.js
clapton-0.0.23 lib/clapton/javascripts/node_modules/lodash/head.js
clapton-0.0.22 lib/clapton/javascripts/node_modules/lodash/head.js