There's a big difference in the compiled output, we never want the enums to change we they should be const.
enum a {
b,
c,
d
}
const enum A2 {
B2,
B3,
B4
}
console.log(a.b);
console.log(A2.B2);
Compiles to:
var a;
(function (a) {
a[a["b"] = 0] = "b";
a[a["c"] = 1] = "c";
a[a["d"] = 2] = "d";
})(a || (a = {}));
console.log(a.b);
console.log(0 /* B2 */);
There's a big difference in the compiled output, we never want the enums to change we they should be const.
Compiles to: