Symbol predicates
Less than 1 minute
Symbol
predicates
category: feature tag:
- es-proposal
---
Modules
Types
interface SymbolConstructor {
isRegisteredSymbol(value: symbol): boolean;
isWellKnownSymbol(value: symbol): boolean;
}
Entry points
core-js/proposals/symbol-predicates-v2
core-js(-pure)/full/symbol/is-registered-symbol
core-js(-pure)/full/symbol/is-well-known-symbol
Example
Symbol.isRegisteredSymbol(Symbol.for("key")); // => true
Symbol.isRegisteredSymbol(Symbol("key")); // => false
Symbol.isWellKnownSymbol(Symbol.iterator); // => true
Symbol.isWellKnownSymbol(Symbol("key")); // => false