Skip to content

Latest commit

 

History

History
54 lines (44 loc) · 1.98 KB

intersection.md

File metadata and controls

54 lines (44 loc) · 1.98 KB

Object Agent

A javascript library for working with objects

npm build coverage deps size vulnerabilities license


intersection(args) ⇒ object

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

Param Type Description
args *, Array An array of arrays or arrays as separate args.

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] }