> For the complete documentation index, see [llms.txt](https://lodash.shujuwajue.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lodash.shujuwajue.com/array/first-head.md).

# \_.first -> head（取数组第一个元素）

**语法：**

```javascript
_.head(array)
```

**源代码链接：**[source](https://github.com/lodash/lodash/blob/4.17.10/lodash.js#L7423)

**npm包链接：**[npm package](https://www.npmjs.com/package/lodash.head)

**描述：**

获取数组的第一个元素。

**开始版本：**&#x30;.1.0

## Aliases

```javascript
_.first
```

**参数：**

* `array (Array)`: 需要查询的数组。

**返回值：**

* `(*)`: 返回数组的第一个元素。

**例子：**

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

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