Files
30-seconds-of-code/snippets/isWeakSet.md
2018-01-16 16:42:17 +02:00

255 B

isWeakSet

Checks if value is classified as a WeakSet object.

Use the instanceofoperator to check if the provided value is a WeakSet object.

const isWeakSet = val => val instanceof WeakSet;
isWeakSet(new WeakSet()); // true