Update formatting

This commit is contained in:
Isabelle Viktoria Maciohsek
2022-01-30 14:13:34 +02:00
parent 254bb58ab5
commit 52487bd328
4 changed files with 5 additions and 4 deletions

View File

@ -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);