Updated tail description
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
### Tail of list
|
||||
|
||||
Return `arr.slice(1)`.
|
||||
Return `arr.slice(1)` if the array's `length` is more than `1`, otherwise return the whole array.
|
||||
|
||||
```js
|
||||
const tail = arr => arr.length > 1 ? arr.slice(1) : arr;
|
||||
|
||||
Reference in New Issue
Block a user