- Notifications
You must be signed in to change notification settings - Fork0
merge
Subhajit Sahu edited this pageJun 19, 2020 ·1 revision
Merge values from two sorted arrays.
Similar:merge, [mergeAll], [rangedMerge].
functionmerge(x,y,fc,fm)// x: an array// y: another array// fc: compare function (a, b)// fm: map function (v, i, x)
constxsortedArray=require('extra-sorted-array');varx=[10,20,20,40,40,80];vary=[20,50,70];xsortedArray.merge(x,y);// → [ 10, 20, 20, 20, 40, 40, 50, 70, 80 ]