Housekeeping, head, tail, init and last of list
This commit is contained in:
8
snippets/last-of-list.md
Normal file
8
snippets/last-of-list.md
Normal file
@ -0,0 +1,8 @@
|
||||
### Last of list
|
||||
|
||||
Return `arr.slice(-1)[0]`.
|
||||
|
||||
```js
|
||||
var initial = arr => arr.slice(-1)[0];
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user