Capitalization: symbol vs. Symbol

# Axel Rauschmayer (11 years ago)

Given that all upcoming value object constructors will start with lowercase letters, shouldn’t Symbol, too?

# Brendan Eich (11 years ago)

Symbols are not value objects, they are primitives like strings, and the 'Symbol' function is analogous to 'String'. See esdiscuss.org/notes/2013-09-18

Consensus/Resolution

  • Symbols are a new primitive type with regular wrapper objects
  • typeof symbol === "symbol"
  • implicit conversion to string throws
  • new Symbol throws
  • Symbols are public, not private - ok that they leak to Proxy
  • Symbols are unique
  • Only exposed via Object.getOwnPropertySymbols instead of Object.getOwnPropertyKeys
  • |Object.mixin| copies both symbol and string properties
# Axel Rauschmayer (11 years ago)

Ah, right. Given that Boolean() produces booleans (etc.), it does indeed fit in nicely.