function cloneArray(array) {
  var length = array ? array.length : 0,
      result = Array(length);

  while (length--) {
    result[length] = array[length];
  }
  return result;
}
Creates a clone of `array`.

@private
@param {Array} array The array to clone.
@returns {Array} Returns the cloned array.