proposal:symbol enum
See original GitHub issueI want symbol enum.
syntax example:
symbol enum Example{
X,Y,Z
}
↓
var Example;
(function (Example) {
Example[Example["X"] = new Symbol("X")] = "X";
Example[Example["Y"] = new Symbol("Y")] = "Y";
Example[Example["Z"] = new Symbol("Z")] = "Z";
})(Example || (Example = {}));
Issue Analytics
- State:
- Created 6 years ago
- Reactions:18
- Comments:8 (1 by maintainers)
Top Results From Across the Web
proposal-enum/README.md at master · rbuckton/proposal-enum ...
@@formatEnum, "Symbol.formatEnum", A method of an enum object that is used to convert a value into a string representation based on the member...
Read more >enum to string in modern C++11 / C++14 / C++17 and future C ...
Magic Enum header-only library provides static reflection for enums (to string, from string, iteration) for C++17. #include <magic_enum.hpp> enum Color ...
Read more >A class-based enum pattern for JavaScript - 2ality
In this blog post, we examine a pattern for implementing enums in JavaScript that is based on classes. We'll also take a look...
Read more >Python Power Tip: Enumerated Types - Towards Data Science
The result was PEP 435, a proposal to add a new enum module to the ... If you accidentally add more than one...
Read more >UITableViewDropProposal.Intent - Documentation
Enumeration. UITableViewDropProposal.Intent. Constants indicating how you intend to handle a drop. iOS 11.0+ iPadOS 11.0+ Mac Catalyst 13.1+. Declaration.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Not to bikeshed, but wouldn’t a more consistent syntax be:
Rather than introducing a new keyword of
symbol
these options either use inheritance style, or Generics, and would pave the way for arbitrary-valued enums?This would be very useful with Redux actions…