MCPcopy
hub / github.com/lodash/lodash / cloneArray

Function cloneArray

fp/_baseConvert.js:44–52  ·  view source on GitHub ↗

* Creates a clone of `array`. * * @private * @param {Array} array The array to clone. * @returns {Array} Returns the cloned array.

(array)

Source from the content-addressed store, hash-verified

42 * @returns {Array} Returns the cloned array.
43 */
44function cloneArray(array) {
45 var length = array ? array.length : 0,
46 result = Array(length);
47
48 while (length--) {
49 result[length] = array[length];
50 }
51 return result;
52}
53
54/**
55 * Creates a function that clones a given object using the assignment `func`.

Callers 1

baseConvertFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected