function arrayAppend(a1, a2, opt_begin, opt_end) {
  var i0 = opt_begin || 0;
  var i1 = opt_end || jsLength(a2);
  for (var i = i0; i < i1; ++i) {
    a1.push(a2[i]);
  }
}
Appends the second array to the first, copying its elements.
Optionally only a slice of the second array is copied.

@param {Array} a1  Target array (modified).
@param {Array} a2  Source array.
@param {Number} opt_begin  Begin of slice of second array (optional).
@param {Number} opt_end  End (exclusive) of slice of second array (optional).