DEV Community

loading...

Discussion on: MVC Calculator in "almost" Vanilla JS

Collapse
corvusetiam profile image
CorvusEtiam Author

Yes, you are right. That is what you get, after using TS too much :).

I would even go as far to tell the best way would be something like this:

const COLOR = Object.freeze({
  RED: 1,
  GREEN: 2,
  BLUE: 3
});

Thanks.

Collapse
aminnairi profile image
Amin

Haha, I knew that! Yes I though about adding the Object.freeze, but I didn't know whether you wanted to go this far or not. But it's great that you added a fully capable example.

Great article. Keep up the good work!