jskatas.org Continuously Learn JavaScript. Your Way.

Symbol: basics

Symbol basics.

Donate to NGO Julenka. Support Ukranians in need. Julenka is an NGO which my brother founded in 2011 to support Ukranian families and kids in need.

Symbol

  • Symbol lives in the global scope
  • every Symbol() is unique
  • every Symbol() is unique, also with the same parameter
  • typeof Symbol() returns "symbol"
  • new Symbol() throws an exception, to prevent creation of Symbol wrapper objects