Complete the code to create a mapped type that makes all properties optional.
type PartialType<T> = { [P in keyof T]?: T[1] };keyof to get keys.The syntax [P in keyof T] iterates over all keys of T to create a mapped type.
Complete the code to create a mapped type that makes all properties readonly.
type ReadonlyType<T> = { readonly [P in keyof T][1] T[P] };= instead of colon :.=> which is for functions.The colon : separates the property name from its type in mapped types.
Fix the error in the mapped type that tries to change all properties to string.
type Stringify<T> = { [P in keyof T]: [1] };T[P] which keeps original types.number.To change all property types to string, assign string as the type.
Fill both blanks to create a mapped type that makes all properties nullable.
type Nullable<T> = { [P in [1]]: T[P][2] null };T instead of keyof T for keys.& null which is intersection, not union.Use keyof T to iterate keys and | null to add nullability.
Fill all three blanks to create a mapped type that picks only string properties from a type.
type PickStrings<T> = { [[1] in keyof T as T[[2]] extends [3] ? [1] : never]: T[[1]] };number instead of string in the condition.This uses key remapping in mapped types to select keys where the property type extends string.