I've seen many cases where we've had a collection of long, ugly, or cryptic strings. Unlike the keys of an enum, a union type does nothing to help describe what a certain string is actually for. Another fairly common usecase is when we have numeric values, if I had to type the network number every time I would waste so much time having to double check the numbers are correct...
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
While I agree that some usecases for enums could be replaced with union types, I can think of a few where enums are a much better fit.
I've seen many cases where we've had a collection of long, ugly, or cryptic strings. Unlike the keys of an enum, a union type does nothing to help describe what a certain string is actually for. Another fairly common usecase is when we have numeric values, if I had to type the network number every time I would waste so much time having to double check the numbers are correct...