[Typescript] 108. Easy - Nullable
Typescript has NonNullable<T>, let's build a Nullable<T>
type Nullable<T extends Record<PropertyKey, unknown>> = {
[K in keyof T]: T[K] | null
}
type t = Nullable<{a: number, b: string}>
Typescript has NonNullable<T>, let's build a Nullable<T>
type Nullable<T extends Record<PropertyKey, unknown>> = {
[K in keyof T]: T[K] | null
}
type t = Nullable<{a: number, b: string}>