typescript array string to array literal code example
Example: typescript array string to array literal
const furniture = ['chair', 'table', 'lamp'] as const;
type Furniture = typeof furniture[number];
const furniture = ['chair', 'table', 'lamp'] as const;
type Furniture = typeof furniture[number];