How to convert an array into string literal union type in TypeScript?
Originally Published Here ๐!
To convert an array of strings into a string literal union type in TypeScript, you can first define the array of strings then make the array as readonly using the as const keyword, and then use the typeof operator on all...
melvingeorge-me.hashnode.dev2 min read