What are the pros and cons of using an enum vs a type alias as below?
const enum LanguageEnum {
English,
Spanish
}
type LanguageAlias = "English" | "Spanish";
let l: LanguageAlias = "English";
let la: LanguageEnum = Language.English
The goal of using the enum is to enumerate the possible values for a type. But doesn't the union of string literals also enumerate the possible types?
I've always found these TS enums to be so weird.