source:
node_modules/es-toolkit/dist/array/dropRight.mjs@
ba17441
| Last change on this file since ba17441 was a762898, checked in by , 6 months ago | |
|---|---|
|
|
| File size: 205 bytes | |
| Rev | Line | |
|---|---|---|
| [a762898] | 1 | function dropRight(arr, itemsCount) { |
| 2 | itemsCount = Math.min(-itemsCount, 0); | |
| 3 | if (itemsCount === 0) { | |
| 4 | return arr.slice(); | |
| 5 | } | |
| 6 | return arr.slice(0, itemsCount); | |
| 7 | } | |
| 8 | ||
| 9 | export { dropRight }; |
Note:
See TracBrowser
for help on using the repository browser.
