Merges two sorted arrays, returning result.
const a = [ 4, 7, 10 ]const b = [ 1, 2, 9, 11 ]const c = merge(a, b);// [ 1, 2, 4, 7, 9, 10, 11 ] Copy
const a = [ 4, 7, 10 ]const b = [ 1, 2, 9, 11 ]const c = merge(a, b);// [ 1, 2, 4, 7, 9, 10, 11 ]
Undefined behaviour if either input array is not sorted.
By default uses Javascript comparision semantics. Passing in comparer is needed when working with an array of objects.
comparer
Sorted array
Comparator
Merges two sorted arrays, returning result.
Undefined behaviour if either input array is not sorted.
By default uses Javascript comparision semantics. Passing in
comparer
is needed when working with an array of objects.