Skip to content

intersectionKeys

Subhajit Sahu edited this page Dec 5, 2022 · 12 revisions

Obtain keys present in all maps.

Similar: unionKeys, intersectionKeys.


function intersectionKeys(...xs)
// xs: maps
const map = require('extra-map');

var x = new Map([['a', 1], ['b', 2], ['c', 3], ['d', 4]]);
var y = new Map([['b', 20], ['c', 30], ['e', 50]]);
map.intersectionKeys(x, y);
// → Set(2) { 'b', 'c' }


References

Clone this wiki locally