in favor of string literal unions. No runtime overhead and consistent with JS. Is there any case where using an enum makes more sense?
I've never used enums, I've always used union types. But they don't seem like the same thing at all. It's just an ambiguous name. Enum in TypeScript is basically an object with constant values. Correct me if I'm wrong
Обсуждают сегодня