Skip to content
This repository has been archived by the owner on Apr 1, 2023. It is now read-only.

Latest commit

 

History

History
54 lines (44 loc) · 1.89 KB

intersection.md

File metadata and controls

54 lines (44 loc) · 1.89 KB

Object Agent

A javascript library for working with objects

npm build coverage deps size vulnerabilities license


intersection() ⇒ Object

Performs a deep comparison of objects and returns a new object of values that are equal in all given objects.

Type
*, Array

Example

import { intersection } from 'object-agent';

intersection([1, 2, 3], [2, 3, 4], [5, 6, 2, 3]); // => [2, 3]

intersection({
    a: 'b',
    c: [1, 2, 3],
    d: null
}, {
    a: 'b',
    c: [1, 3, 4]
})
// => { a: 'b', c: [1, 3] }