Update formatting
This commit is contained in:
@ -7,7 +7,8 @@ lastUpdated: 2020-10-22T20:24:30+03:00
|
||||
|
||||
Returns all elements in an array except for the first one.
|
||||
|
||||
- Return `Array.prototype.slice(1)` if `Array.prototype.length` is more than `1`, otherwise, return the whole array.
|
||||
- Use `Array.prototype.slice()`to return the array without the first element if `Array.prototype.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