Skip to content
dreamcode
dreamcode
Lesson
Practice · Mapped
  1. Predict
  2. Arrange
  3. Fill in
+20 XP on finish
PREDICT · READ BEFORE YOU WRITE

What type modifier is added by this mapped type?

Trace the program the way the computer would, then make your call before running anything.

type ReadOnly<T> = { readonly [K in keyof T]: T[K] };
interface Point { x: number; }
const p: ReadOnly<Point> = { x: 5 };