DEV Community

Discussion on: Symbols Are Your Friend Part V: Symbol.toPrimitive, Symbol.toStringTag, & Symbol.unscopables

Collapse
 
lowlighter profile image
lowlighter πŸ¦‘

Nice article !

Symbols are really a cool feature, although I guess they're not that much used since basically using Symbol.toPrimitive and Symbol.toStringTag is globally the same as using valueOf() and toString() (although like you said there's a few differences).

More features is always a plus, since it allows you to bend the languages to your will rather than the contrary.

That's why I'm kind of sad that with was trashed out. I understand why some people didn't like it, but a shame it didn't stick around. Would have been quite cool to use with (this) in ES classes to mimic other languages like C++ or Java where this is implicit inside a class.