Updated tail description

This commit is contained in:
Angelos Chalaris
2017-12-13 11:40:27 +02:00
parent 7cc4f81d6f
commit 07d4086c18
2 changed files with 2 additions and 2 deletions

View File

@ -512,7 +512,7 @@ Use array destructuring to swap values between two variables.
### Tail of list ### 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 ```js
const tail = arr => arr.length > 1 ? arr.slice(1) : arr; const tail = arr => arr.length > 1 ? arr.slice(1) : arr;

View File

@ -1,6 +1,6 @@
### Tail of list ### 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 ```js
const tail = arr => arr.length > 1 ? arr.slice(1) : arr; const tail = arr => arr.length > 1 ? arr.slice(1) : arr;