News for hackers. Stuff that matters.
Re:All JavaScript and TypeScript features of the last 3 year... by treis on Thursday March 09, 2023 @12:05PM (#35083547)
>* EXCEPT IF I WANT TO USE AN ENUM/TYPE AS A KEY IN AN DICT WHICH I REALLY WANT TO DO!!

It's better just to use an actual array for enums:

myEnum = ["E1", "E2"...] as const

type myEnum = typeof myEnum[number]

That gets you both an enum type and an enum array you can use at runtime

There are no comments on this comment yet.