Question mark Typescript variable

前端 未结 3 678
闹比i
闹比i 2021-01-17 22:04

I\'ve seen code snippets like these:

export interface IUser {
    email?: string;
    firstName?: string;
    lastName?: string;
}

But why

3条回答
  •  [愿得一人]
    2021-01-17 22:47

    If I am not mistaked, its to indicate that its optional, that means that it can be null.

提交回复
热议问题