Symbol Symbol Object
Last updated: 2026-09-09
Symbol Symbol Object
Symbol is an ES6 primitive creating unique identifiers for object keys.
| Category | Data Types |
|---|---|
| ES version | ES1 |
📝 Syntax
const sym = Symbol('desc');
▶ Example
Edit the code, press Run, and see the result in the output panel:
Output:
12345
['name']
💡 Tip Symbol keys are hidden from Object.keys.
ℹ️ info Symbol.for creates globally shared symbols.
🏷️ Related Items
💡 Related Cases
More case studies coming soon — check back later.
📚 Related Tutorials
❓ FAQ
QWhat are Symbols for?
AUnique identifiers to avoid collisions.
QSymbol.for vs Symbol?
ASymbol.for shared; Symbol unique.
QCan Symbol be a string?
AUse String(sym) or sym.description.