You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Symbols were introduces with the primary purpose of being used as object keys, and are still primarily, if not only, used with that purpose. To not be usable as keys makes no sense whatsoever. They can be used on any object type too, array, generic object, map, Element, etc.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
TypeScript Version: 4.0.0-dev.20200725
Search Terms:
Symbols as object keys
Code
Expected behavior:
The code compiles without error.
Actual behavior:
TSC throws an error disallowing symbols to be used as object keys.
Playground Link: https://www.typescriptlang.org/play?ts=4.0.0-dev.20200725#code/C4TwDgpgBAziC2AjA9gGwNIRFAvFA3gFBQlQDaA1lgFywIqoC6tAhgHYiEC+A3EA
Related Issues: Couldn't find anything related
Symbols were introduces with the primary purpose of being used as object keys, and are still primarily, if not only, used with that purpose. To not be usable as keys makes no sense whatsoever. They can be used on any object type too, array, generic object, map, Element, etc.
The text was updated successfully, but these errors were encountered: