Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

typescript array string to array literal

const furniture = ['chair', 'table', 'lamp'] as const;
type Furniture = typeof furniture[number];
 
PREVIOUS NEXT
Tagged: #typescript #array #string #array #literal
ADD COMMENT
Topic
Name
4+5 =