Skip to content

isWeakMap

Checks if the given value is a WeakMap. Instances from [other realms][1] are also supported. [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof#instanceof_and_multiple_realms

Usage

isWeakMap(new WeakMap()); // => true
isWeakMap(new Map()); // => false

Installation

Terminal window
npx atmx add helper is-weak-map