Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in Symbol Type example #49

Closed
bamoqi opened this issue Oct 30, 2015 · 2 comments
Closed

Error in Symbol Type example #49

bamoqi opened this issue Oct 30, 2015 · 2 comments

Comments

@bamoqi
Copy link

bamoqi commented Oct 30, 2015

In http://es6-features.org/#SymbolType
Object.getOwnPropertySymbols(obj) // [ foo, bar ]
Should be
Object.getOwnPropertySymbols(obj) // [ Symbol(), Symbol() ]

In http://es6-features.org/#GlobalSymbols
shoud be
Object.getOwnPropertySymbols(obj) // [ Symbol(app.foo), Symbol(app.bar) ]

@rse
Copy link
Owner

rse commented Oct 30, 2015

Sorry for the dump question, but WHY? Your [ Symbol(), Symbol() ] represents an array of completely new symbols but getOwnPropertySymbols returns an array of exactly the symbols one placed as keys into the object AFAIK. That's what I wanted to express with [ foo, bar ] because these are the constants the symbols were assigned to beforehand in the examples. Why is this wrong?

@bamoqi
Copy link
Author

bamoqi commented Oct 31, 2015

Yes now I see it is correct. I misunderstood that you meant to show the printed representation of the array, which would be [ Symbol(), Symbol() ] . Sorry for the wrong report and not communicating clearly.

@bamoqi bamoqi closed this as completed Oct 31, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants