Like _.pullAll, but accepts a comparator invoked as (arrVal, othVal) to decide matches. Returns the same array (mutated). Part of Lodash 4.x Array (since 4.6.0).
pullAll. Compares references — the ban object is new.
No remove. Nothing is the same reference, so a stays.
pullAllWith._.isEqual sees structural equality.
Rule. Prefer pullAllWith (or pullAllBy) for object rows.
Compatibility
Browser & Runtime Support
_.pullAllWith is a Lodash 4.x Array helper (since 4.6.0). It runs anywhere Lodash runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install lodash.
✓ Stable · Lodash 4.x
_.pullAllWith()
Available in [email protected] full builds and the lodash/pullAllWith modular import. There is no single native twin — closest patterns are a mutating filter with a custom equals, or _.differenceWith for a new array.
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
_.pullAllWithLodash 4.x+
Bottom line: Safe for production once Lodash is loaded. Prefer import pullAllWith from "lodash/pullAllWith" for smaller bundles. Remember: this helper mutates — pair with differenceWith when you need immutability.
Frequently Asked Questions
_.pullAllWith(array, values, comparator) removes elements from array when comparator(arrVal, othVal) is truthy for any value in the values list. It mutates array and returns the same reference.
Yes. Unlike _.differenceWith, pullAllWith changes the array you pass in. Clone first if you need the old contents.
Return a truthy value when the two arguments should count as a match for removal. Return falsy to keep the element. Symmetric rules are easiest to reason about.
pullAllBy maps each side through one iteratee and compares projections with SameValueZero. pullAllWith hands both raw values to your comparator for deep equality, tolerances, or multi-field rules.
Yes. That is the usual choice for removing nested objects that are structurally equal but not the same reference.
Use import pullAllWith from "lodash/pullAllWith" or require("lodash/pullAllWith") for tree-shaking friendly bundles. Full build: import _ from "lodash" then _.pullAllWith.