Like _.pullAll, but accepts an iteratee to build the comparison key for each element of array and values. Returns the same array (mutated). Part of Lodash 4.x Array (since 4.0.0).
pullAll. Compares object references — the ban object is a new {x:1}.
No remove. Nothing is the same reference, so a is unchanged.
pullAllBy. Compares x values — key 1 matches.
Rule. Prefer pullAllBy when matching objects by field.
Compatibility
Browser & Runtime Support
_.pullAllBy is a Lodash 4.x Array helper (since 4.0.0). It runs anywhere Lodash runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install lodash.
✓ Stable · Lodash 4.x
_.pullAllBy()
Available in [email protected] full builds and the lodash/pullAllBy modular import. There is no single native twin — closest patterns are a mutating filter loop or _.differenceBy 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
_.pullAllByLodash 4.x+
Bottom line: Safe for production once Lodash is loaded. Prefer import pullAllBy from "lodash/pullAllBy" for smaller bundles. Remember: this helper mutates — pair with differenceBy when you need immutability.
Frequently Asked Questions
_.pullAllBy(array, values, iteratee) removes elements from array when the iteratee result matches any iteratee result from values. It mutates array and returns the same reference.
Yes. Unlike _.differenceBy, pullAllBy changes the array you pass in. Clone first if you need the old contents.
It maps each element of array and each element of values to a comparison key. Removals use SameValueZero on those mapped results.
pullAll compares raw elements. pullAllBy compares iteratee output — so you can drop rows by id or property without matching whole objects.
Yes. A string like "x" is Lodash property shorthand — same idea as (item) => item.x for plain objects.
Use import pullAllBy from "lodash/pullAllBy" or require("lodash/pullAllBy") for tree-shaking friendly bundles. Full build: import _ from "lodash" then _.pullAllBy.