Merge branch 'master' of https://github.com/Chalarangelo/30-seconds-of-code
This commit is contained in:
@ -4,7 +4,6 @@ Use `Array.slice()` to create a slice of the array with `n` elements taken from
|
||||
|
||||
```js
|
||||
const take = (arr, n = 1) => arr.slice(0, n);
|
||||
|
||||
// take([1, 2, 3], 5) -> [1, 2, 3]
|
||||
// take([1, 2, 3], 0) -> []
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user