_.head

source npm package

Gets the first element of array.

Since

0.1.0

Aliases

_.first

Arguments

  1. array (Array): The array to query.

Returns

(*): Returns the first element of array.

Example

_.head([1, 2, 3]);
// => 1
 
_.head([]);
// => undefined