We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Obtain values present in both sorted arrays.
Similar: [union], intersection, [difference], [symmetricDifference].
function intersection(x, y, fc, fm) // x: a sorted array // y: another sorted 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, 80]; xsortedArray.intersection(x, y); // → [ 20, 80 ]