Symbol API
Unique and immutable primitive values as object property keys.
Symbol is a primitive data type where values are unique and immutable. Symbols are often used as identifiers for object properties to avoid name clashes, especially in environments where objects from different sources need to coexist.
Symbols are created with the Symbol() function, and each symbol value returned by Symbol() is unique. Symbols can be used as identifiers for object properties and are useful for defining a set of constants, implementing private or internal properties, or creating hooks in metaprogramming.
Every symbol value returned from Symbol() is unique, even if the symbols have the same description. The Symbol.for() method creates a symbol in a global symbol registry, and Symbol.keyFor() retrieves a symbol key from the registry.