Creates an array of unique values included in all given arrays, using SameValueZero equality. Order and references follow the first array. Part of Lodash 4.x Array.
Pass the required arguments shown below. Lodash Array helpers usually return a new value — check whether the source array is mutated.
Syntax
Call _.intersection on an array. Start with this line.
Lodash
_.intersection([arrays])
Call
What it does
_.intersection([arrays])
Primary signature.
_.intersection(array)
Call with an array argument.
Prefer import intersection from "lodash/intersection" when you want a smaller bundle.
Tip. Put the array whose order you care about first.
Compatibility
Browser & Runtime Support
_.intersection is a Lodash 4.x Array helper (available since early Lodash). It runs anywhere Lodash runs — modern browsers (via CDN or bundle) and Node.js / Bun / Deno with npm install lodash.
✓ Stable · Lodash 4.x
_.intersection()
Available in [email protected] full builds and the lodash/intersection modular import. Works in evergreen browsers and current Node LTS when Lodash is installed.
100%With Lodash 4.x
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
BunSupported · JavaScript runtime
Supported
DenoSupported · JavaScript runtime
Supported
Node.jsSupported · Server runtime
Supported
Android WebViewSupported · Modern WebView
Full support
_.intersectionLodash 4.x+
Bottom line: Safe for production once Lodash is on the page or in your bundle. Prefer import intersection from "lodash/intersection" for smaller builds. Native Set intersection patterns exist in modern JS but differ in API shape.
Frequently Asked Questions
_.intersection(...arrays) returns a new array of unique values that appear in every given array, using SameValueZero equality. Order and object references follow the first array.
No. It returns a new array. Each argument array stays unchanged.
The first array. Values are listed in the order they first appear there, if they also exist in every other array.
difference removes values found in the other lists. intersection keeps only values present in all lists.
Use _.intersectionBy when equality should run on a projected key (like a property). Use _.intersectionWith for a custom comparator function.
Use import intersection from "lodash/intersection" or require("lodash/intersection") for tree-shaking friendly bundles. Full build: import _ from "lodash" then _.intersection.