Search⌘ K
AI Features

Quiz

Review and assess your understanding of applying TypeScript generics to functions, interfaces, aliases, and classes within React. This quiz helps consolidate your knowledge before moving on to using these types directly in React components.

We'll cover the following...

Working with generic types

1.

We have a type within our codebase for a comment:

type Comment = {
  comment: string;
  email: string;
}

What generic type can we use with Comment that would create a type equivalent to the type below:

type ReadonlyComment = {
  readonly comment: string;
  readonly email: string;
}
A.

Readonly<Comment>

B.

Required<Comment>

C.

Partial<Comment>


1 / 5

Well done!

Now that we ...