#Magical enums in ES6 My brain exploded with creativity today with this nefarious trick to make an enum by manipulating the syntax in ES6. The browser vendors will probably find this and block this from shipping, but it will still work with a transpiler (webpack + 6to5). To understand this you will need to know ES6 Proxies, ES6 modules, and Symbols.
your-code.js
import { blue, red, orange } from 'magic-enum';
var color = blue;
switch (color) {