JavaScript Symbol Guide
Symbols are primitive values introduced in ES6 that serve as unique identifiers. They are often used as object property keys to avoid name collisions. The guide walks through Creating Symbols, Well-Known Symbols, Symbol Properties. `Symbol()` creates a unique symbol. `Symbol("description")` adds an optional description for debugging. `Symbol.for("key")` creates/retrieves symbols from the global registry. `Symbol.keyFor()` gets the registry key. `Symbol.iterator`, `Symbol.asyncIterator`, `Symbol.toStringTag`, `Symbol.toPrimitive`, `Symbol.hasInstance`, `Symbol.species`, `Symbol.match`, `Symbol.replace`, `Symbol.search`, `Symbol.split` customize object behavior. The guide is organized into 3 sections that build on each other, each pairing a prose explanation with runnable code. Browse the individual methods covered by this guide in the Symbol category. Key APIs covered include Symbol(), Symbol.for(), Symbol.keyFor(), Symbol.prototype.toString(), Symbol.iterator, Symbol.asyncIterator. Related guides: Arrays, Strings, Numbers, Math, Date. This is one of 145 JavaScript guides on JS Reference — see the full list on the guides page.