* 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)
| 14591 | * @returns {Array} Returns `array`. |
| 14592 | */ |
| 14593 | function arrayCopy(source, array) { |
| 14594 | var index = -1, |
| 14595 | length = source.length; |
| 14596 | |
| 14597 | array || (array = Array(length)); |
| 14598 | while (++index < length) { |
| 14599 | array[index] = source[index]; |
| 14600 | } |
| 14601 | return array; |
| 14602 | } |
| 14603 | |
| 14604 | module.exports = arrayCopy; |
| 14605 |
no outgoing calls
no test coverage detected