Skip to content

intersectionKeys

Subhajit Sahu edited this page Jun 11, 2020 · 12 revisions

Gives keys present in all objects. 🏃 📼 📦 🌔 📒

Similar: unionKeys, intersectionKeys.

object.intersectionKeys(...xs);
// xs: objects
const object = require('extra-object');

var x = {a: 1, b: 2, c: 3, d: 4};
var y = {b: 20, c: 30, e: 50};
object.intersectionKeys(x, y);
// Set(2) { 'b', 'c' }

references

Clone this wiki locally