Files
30-seconds-of-code/snippets/last-of-list.md
Rob Murray 476e3f1a88 Change last-of-list function name
Update Last of List function name to `last` to avoid confusion.
2017-12-12 10:08:30 +00:00

8 lines
92 B
Markdown

### Last of list
Return `arr.slice(-1)[0]`.
```js
var last = arr => arr.slice(-1)[0];
```