News for hackers. Stuff that matters.
Re:ES6 in Depth – Symbols by meric on Friday June 12, 2015 @07:42AM (#9705243)
Looks like Symbols is a type being introduced because objects, when used as a key in another object, gets turned into a string, unlike Lua tables can be used as keys of other tables, and are guaranteed to not be equal to any other value. Lua tables are built-in symbols. Javascript's objects are not.
Re:ES6 in Depth – Symbols by bcoates on Friday June 12, 2015 @09:24AM (#9705662)
Yeah, it seems like kind of an odd choice to introduce a whole new type and extend the kind of values that can index an object, when extending object indexing alone would do everything symbols do anyway.
Re:ES6 in Depth – Symbols by quarterto on Friday June 12, 2015 @09:35AM (#9705726)
It's actually not extending object indexing. From the object's point of view, the symbol is just another (albeit opaque) string.
Re:ES6 in Depth – Symbols by bcoates on Friday June 12, 2015 @09:47AM (#9705798)
There's still some magic involving the symbol properties being automatically non-enumerable, right?
Re:ES6 in Depth – Symbols by thomasfoster96 on Friday June 12, 2015 @08:34AM (#9705432)
Are you talking about Maps in ES6 or Symbols? Using an object as a key is what you can do with Maps.