_.isWeakSet is a Lodash Lang helper (available since 4.3.0, stable in 4.x). It runs anywhere Lodash runs — modern browsers (via CDN or bundle) and Node.js / Bun / Deno with npm install lodash. The host must also provide the ES WeakSet built-in (all evergreen engines do).
✓ Stable · Lodash 4.3.0+
_.isWeakSet()
Available in [email protected] full builds and the lodash/isWeakSet modular import. Works in evergreen browsers and current Node LTS when Lodash is installed.
100%With Lodash 4.x + WeakSet
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
_.isWeakSetLodash 4.3.0+
Bottom line: Safe for production once Lodash is on the page or in your bundle. Prefer import isWeakSet from "lodash/isWeakSet" for smaller builds. Native alternative: value instanceof WeakSet (note iframe/realm caveats).
Frequently Asked Questions
_.isWeakSet(value) returns true if value is classified as a WeakSet object, otherwise false. Set, WeakMap, plain objects, and arrays all return false.
Set is a different built-in type with its own brand ([object Set]). Lodash exposes _.isSet for that check.
WeakSet only stores objects, holds them weakly (members can be GC’d when unreachable), and is not iterable — no .size, .values(), .clear(), or for…of.
Yes. _.isWeakSet(new WeakSet()) is true whether it has members or not — the check is about type, not contents.
No. Duck-typed objects are not WeakSets. Lodash looks for a real WeakSet classification, not method names.
Use import isWeakSet from "lodash/isWeakSet" or require("lodash/isWeakSet"). Full build: import _ from "lodash" then _.isWeakSet.