主题
head
js
_.head(array)获取 array 的第一个元素。
¥Gets the first element of array.
新增于
¥Since
0.1.0
别名
¥Aliases
_.first
参数
¥Arguments
array(数组):要查询的数组。¥
array(Array): The array to query.
返回
¥Returns
(*):返回 array 的第一个元素。
¥()*: Returns the first element of array.
示例
¥Example
js
_.head([1, 2, 3]);
// => 1
_.head([]);
// => undefined