I have an array:
const specialNumbers = [1, 10, 20, 50] as const; // type: readonly [1, 10, 20, 50]
I would like a type (ex: SpecialNumber) that is the union of the values in the arrays.
For example to be used as:
const getSpecialNumber = (): SpecialNumber => { // SpecialNumber = 1 | 10 | 20 | 50
// ...
}
How to construct SpecialNumber from specialNumbers?
[1, 10, 20, 50] as const; // type: readonly [2, 4, 6, 8]" - something is off there