Skip to content

head

js
_.head(array)

获取 array 的第一个元素。

¥Gets the first element of array.

新增于

¥Since

0.1.0

别名

¥Aliases

_.first

参数

¥Arguments

  1. array (数组):要查询的数组。

    ¥array (Array): The array to query.

返回

¥Returns

(*):返回 array 的第一个元素。

¥()*: Returns the first element of array.

示例

¥Example

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

_.head([]);
// => undefined

Lodash v4.17 中文网 - 粤ICP备13048890号