Reputation: 11830
I have an interface like this
export interface Font {
id: number
table_definition_id: number
auth: boolean | null
The interface always have key auth
with value boolean or null
If I change it to
export interface Font {
id: number
table_definition_id: number
auth?: boolean
}
Will this be valid?
Upvotes: 0
Views: 32
Reputation: 586
It wouldn't be valid because then auth could be either boolean or undefined, never null
Upvotes: 1