Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

array of objects typescript

let userTestStatus: { id: number, name: string }[] = [
    { "id": 0, "name": "Available" },
    { "id": 1, "name": "Ready" },
    { "id": 2, "name": "Started" }
];

userTestStatus[34978].nammme; // Error: Property 'nammme' does not exist on type [...]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #array #objects #typescript
ADD COMMENT
Topic
Name
8+4 =