cf.completefrontend

Predict the typesMedium

Does readonly stop these mutations? What does TypeScript report, and what does the code log?

Name the type the ^? line points at, every error TypeScript reports, and what the code logs when you run it anyway, with its types removed.

What does TypeScript report here?
interface Point {  readonly x: number;  y: number;}interface MutablePoint {  x: number;  y: number;} const origin: Point = { x: 0, y: 0 };origin.x = 1; const alias: MutablePoint = origin;alias.x = 2; const settings = Object.freeze({ theme: "dark", tags: ["a"] });//    ^?settings.tags.push("b"); console.log(origin.x, settings.tags);

Work it out first: the compiler shows every error and type.

The answer

Work out every error TypeScript reports and every type it shows, line by line. Then check.

Checking your sign-in…