MCPcopy
hub / github.com/lodash/lodash / copyArray

Function copyArray

lodash.js:4832–4841  ·  view source on GitHub ↗

* Copies the values of `source` to `array`. * * @private * @param {Array} source The array to copy values from. * @param {Array} [array=[]] The array to copy values to. * @returns {Array} Returns `array`.

(source, array)

Source from the content-addressed store, hash-verified

4830 * @returns {Array} Returns `array`.
4831 */
4832 function copyArray(source, array) {
4833 var index = -1,
4834 length = source.length;
4835
4836 array || (array = Array(length));
4837 while (++index < length) {
4838 array[index] = source[index];
4839 }
4840 return array;
4841 }
4842
4843 /**
4844 * Copies properties of `source` to `object`.

Callers 12

lazyCloneFunction · 0.85
arraySampleSizeFunction · 0.85
arrayShuffleFunction · 0.85
baseCloneFunction · 0.85
baseMergeDeepFunction · 0.85
basePullAllFunction · 0.85
reorderFunction · 0.85
wrapperCloneFunction · 0.85
concatFunction · 0.85
toArrayFunction · 0.85
mixinFunction · 0.85
toPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected