cf.completefrontend

Predict the typesEasy

What types does TypeScript infer for these variables and this function?

The only annotation is the parameter's. Name the type each ^? line points at, and say whether TypeScript reports any errors.

What does TypeScript report here?
let count = 0;//  ^?const ids = [1, 2, 3];//    ^?function greet(name: string) {//       ^?  return `Hello, ${name}`;} let later;//  ^?later = "ready";const status = later;//    ^?

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…