I'm experimenting with the new ES6 Symbols in Google Chrome, and after enabling "Experimental JavaScript" in Chrome Flags, I can use new Symbol()
in my code.
However, when I try to run the following code:
var sym = new Symbol();
var obj = {};
obj[sym] = 'Hello, symbols';
I get the following error:
TypeError: Conversion from symbol to string
What's wrong with my code?
Thanks!