Symbol Uniqueness Quiz
Multiple Choice Medium
Question
What is the result of `Symbol('x') === Symbol('x')`?
Hint
Symbols are always unique.
Explanation
Each call to Symbol() creates a completely unique symbol, even if the description string is the same. Symbol('x') and Symbol('x') are two different symbols, so === is false. To create a shared symbol, use Symbol.for('x') (the global symbol registry). Symbols are used as unique object keys to avoid property collisions.
Related Resources
Related Lessons
- JavaScript Data Types
Learn about Symbols.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.