Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

_copyArray.js 454B

1234567891011121314151617181920
  1. /**
  2. * Copies the values of `source` to `array`.
  3. *
  4. * @private
  5. * @param {Array} source The array to copy values from.
  6. * @param {Array} [array=[]] The array to copy values to.
  7. * @returns {Array} Returns `array`.
  8. */
  9. function copyArray(source, array) {
  10. var index = -1,
  11. length = source.length;
  12. array || (array = Array(length));
  13. while (++index < length) {
  14. array[index] = source[index];
  15. }
  16. return array;
  17. }
  18. module.exports = copyArray;