This repository contains two TypeScript code snippets that demonstrate how to use enums in TypeScript.
"use strict";
var Color;
(function (Color) {
Color["Red"] = "red";
Color["Green"] = "green";
Color["Blue"] = "blue";
})(Color || (Color = {}));
getColor(colors.red);
"use strict";
const colors = {
red: 'red',
green: 'green',
blue: 'blue'
};
getColor(colors.red);
117 bytes vs 84 bytes