I\'m rebuilding an old Java project in Javascript, and realized that there\'s no good way to do enums in JS.
The best I can come up with is:
const C
This is my personal approach.
class ColorType { static get RED () { return "red"; } static get GREEN () { return "green"; } static get BLUE () { return "blue"; } } // Use case. const color = Color.create(ColorType.RED);