Complete the code to make all properties of Person readonly.
type ReadonlyPerson = { readonly [K in keyof Person][1] };In mapped types, readonly [K in keyof Person]: Person[K] makes all properties readonly by adding readonly and keeping the property types.
Complete the code to make all properties of Person optional.
type OptionalPerson = { [K in keyof Person][1] };Adding ? after the key in a mapped type makes the property optional.
Fix the error in the mapped type to remove the readonly modifier from all properties.
type MutablePerson = { -readonly [K in keyof Person][1] };The -readonly modifier removes the readonly attribute, and the property type must follow a colon.
Fill both blanks to create a mapped type that makes all properties readonly and optional.
type ReadonlyOptionalPerson = { readonly [K in keyof Person][1] };To make properties both readonly and optional, add readonly before the key and ? after the key, then specify the type with a colon.
Fill all three blanks to create a mapped type that removes readonly and optional modifiers from all properties.
type RequiredMutablePerson = { -readonly [K in keyof Person][1] };To remove readonly and optional modifiers, use -readonly before the key and -? after the key, then specify the property type with a colon. The -? removes optionality.