Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
seanalltogether
on June 26, 2015
|
parent
|
context
|
favorite
| on:
Metaprogramming in ES6: Symbols and why they're aw...
This is a bit confusing to me, if the key doesn't matter and no two symbols are equal, why would you ever use
var foo = Symbol('foo')
over
var foo = Symbol()
kannanvijayan
on June 26, 2015
[–]
Mostly as a debugging aid. Stringifying the symbol will let you get at the internal string, which can be useful for tooling, introspection, etc.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
var foo = Symbol('foo')
over
var foo = Symbol()