Update take.md
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
### Take
|
||||
|
||||
Use `.slice()` to create a slice of the array with n elements taken from the beginning.
|
||||
Use `Array.slice()` to create a slice of the array with `n` elements taken from the beginning.
|
||||
|
||||
```js
|
||||
const take = (arr, n = 1) => arr.slice(0, n);
|
||||
|
||||
Reference in New Issue
Block a user