News for hackers. Stuff that matters.
Re:TypeScript Features to Avoid by ragnese on Thursday January 20, 2022 @03:34PM (#30014458)
Yes, I didn't intend to imply otherwise, but I could've elaborated.

Some people will argue a preference for string literal union types over enums because the string literal types don't have any runtime overhead. They just provide type safety at write-time and are bare strings at runtime. But as soon as you start adding arrays and custom type predicate functions to work with them, you're adding runtime objects, which removes that particular advantage over enums.

There are no comments on this comment yet.