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