There was an error while loading. Please reload this page.
Merge values from two sorted arrays.
Similar: merge, [mergeAll], [rangedMerge].
function merge(x, y, fc, fm) // x: an array // y: another array // fc: compare function (a, b) // fm: map function (v, i, x)
const xsortedArray = require('extra-sorted-array'); var x = [10, 20, 20, 40, 40, 80]; var y = [20, 50, 70]; xsortedArray.merge(x, y); // → [ 10, 20, 20, 20, 40, 40, 50, 70, 80 ]