cf.completefrontend

Predict the typesMedium

Which of these arguments does TypeScript accept for an object parameter, and which for a Record<string, unknown> parameter?

Both functions take "some object". Say every error TypeScript reports, and name the type the ^? line points at.

What does TypeScript report here?
interface User {  name: string;}type Point = { x: number; y: number }; declare const user: User;declare const point: Point; function remember(value: object) {}function serialize(value: Record<string, unknown>) {  const field = value.anything;  //    ^?} remember(user);remember([1, 2]);remember("text"); serialize(point);serialize(user);serialize([1, 2]);

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…