Skip to content

intersection$

Subhajit Sahu edited this page May 9, 2020 · 18 revisions

Gives entries present in all maps. 🏃 📼 📦 🌔

map.intersection$(x, ...ys);
// x:  a map (updated)
// ys: other maps
// --> x
const map = require('extra-map');

var x = new Map([['A', 1], ['B', 2], ['C', -3]]);
var y = new Map([['A', 1], ['B', 2]]);
var z = new Map([['B', 2], ['C', -3]]);
map.intersection$(x, y, z);
// Map(1) { 'B' => 2 }

x;
// Map(1) { 'B' => 2 }
Clone this wiki locally