I have an array of strings:
let foo = ["bar", "baz"];
I wish to perform something similar to keyof type foo
, but for an array rather than an object:
type DESIRED_RESULT = "bar"|"baz";
Is there any way to convert all unique strings within an array to a type?