Symbol type thumbnail
Symbol type
javascript.info
Symbols are guaranteed to be unique. Even if we create many symbols with exactly the same description, they are different values. The description is just a label that doesn’t affect anything. As we’ve seen, usually all symbols are different, even if they have the same name. But sometimes we want sam
9 Users
0 Comments
65 Highlights
2 Notes

Top Highlights

  • Symbols are guaranteed to be unique. Even if we create many symbols with exactly the same description, they are different values. The description is just a label that doesn’t affect anything.
  • As we’ve seen, usually all symbols are different, even if they have the same name. But sometimes we want same-named symbols to be same entities. For instance, different parts of our application want to access symbol "id" meaning exactly the same property. To achieve that, there exists
  • If we want to use a symbol in an object literal {...}, we need square brackets around it.
  • mostly useful for debugging purposes:
  • Symbols are special. They don’t auto-convert.

Ready to highlight and find good content?

Glasp is a social web highlighter that people can highlight and organize quotes and thoughts from the web, and access other like-minded people’s learning.