Skip to content

last ​

js
_.last(array)

获取 array 的最后一个元素。

¥Gets the last element of array.

新增于 ​

¥Since

0.1.0

参数 ​

¥Arguments

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

    ¥array (Array): The array to query.

返回 ​

¥Returns

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

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

示例 ​

¥Example

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

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