const items = [10, 20, 30, 40, 50];
const last_item = _.last(items);
// => 50
In the code snippet, we have an array named items that contain some values and we want to get the last value of this array. To get the last value from the array we are using the below syntax.
_.last(items)
_.last(Array)
The method takes Array parameter as required parameter .
0 Comments