Quiz · Object types · lesson 7 of 7
Quiz — which line fails
On which line does tsc report an error?
type Order = { readonly id: number; total: number };
const o: Order = { id: 1, total: 50 };
o.total = 60;
o.id = 2;
console.log(o.id, o.total);On which line does tsc report an error?
type Order = { readonly id: number; total: number };
const o: Order = { id: 1, total: 50 };
o.total = 60;
o.id = 2;
console.log(o.id, o.total);