Typescript objects

up:: Typescript

let employee: {
    [key: string]: string | number | undefined; // return value from the key is either a `string` (since all values are strings), or `undefined` (since some keys are optional)
	// type annotations
	readonly id: number,
	name: string,
} = { id: 1, name: 'Josch' };
 
employee.id = 2 // type error because of readonly