UNPKG

es-toolkit

Version:

A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.

13 lines (11 loc) 261 B
function copyArray(source, array) { const length = source.length; if (array == null) { array = Array(length); } for (let i = 0; i < length; i++) { array[i] = source[i]; } return array; } export { copyArray as default };