last source npm

_.last(array)

获取数组中的最后一个元素

参数

  1. array (Array)

    要检索的数组

返回值 (*)

返回数组中的最后一个元素

示例

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