cf.completefrontend

Predict the typesMedium

Which of these type assertions does TypeScript accept, and what types do they give?

Name the type each ^? line points at, and every error TypeScript reports.

What does TypeScript report here?
type User = { id: number; name: string }; const count = "42" as number;const forced = "42" as unknown as number;const draft = {} as User;const typed: User = {};const app = document.getElementById("app")!;//    ^?const email = document.querySelector("#email") as HTMLInputElement;//    ^?

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…