0

simple question there but I struggle to find an answer, all existing answers are for enum to array.

I wonder if there is a way to transform a string array:

const arr = [ 'a', 'b', 'c' ]

into the equivalent of

type myType = 'a' | 'b' | 'c'

?

TOPKAT
  • 6,667
  • 2
  • 44
  • 72

0 Answers0