source:
node_modules/es-toolkit/dist/compat/_internal/copyArray.mjs
| Last change on this file was a762898, checked in by , 5 months ago | |
|---|---|
|
|
| File size: 261 bytes | |
| Rev | Line | |
|---|---|---|
| [a762898] | 1 | function copyArray(source, array) { |
| 2 | const length = source.length; | |
| 3 | if (array == null) { | |
| 4 | array = Array(length); | |
| 5 | } | |
| 6 | for (let i = 0; i < length; i++) { | |
| 7 | array[i] = source[i]; | |
| 8 | } | |
| 9 | return array; | |
| 10 | } | |
| 11 | ||
| 12 | export { copyArray as default }; |
Note:
See TracBrowser
for help on using the repository browser.
