Quiz

Test your knowledge on generic types with this quiz.

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>

Question 1 of 50 attempted

Get hands-on with 1200+ tech skills courses.