source:
node_modules/es-toolkit/dist/array/take.mjs@
ba17441
| Last change on this file since ba17441 was a762898, checked in by , 5 months ago | |
|---|---|
|
|
| File size: 211 bytes | |
| Rev | Line | |
|---|---|---|
| [a762898] | 1 | import { toInteger } from '../compat/util/toInteger.mjs'; |
| 2 | ||
| 3 | function take(arr, count, guard) { | |
| 4 | count = guard || count === undefined ? 1 : toInteger(count); | |
| 5 | return arr.slice(0, count); | |
| 6 | } | |
| 7 | ||
| 8 | export { take }; |
Note:
See TracBrowser
for help on using the repository browser.
