1

What does ?(question mark) and the !(exclamation mark) means in declaring these variables in typescript?

title?: string;

form!: FormGroup;

Is this the same as non-null assertion operator?

pp_jj
  • 11
  • 2
  • Depends on where it occurs because the very same `title?: string` may be allowed in one place but forbidden in another Please give a bit more context – derpirscher Jan 14 '23 at 18:07
  • For the usage of `!`, see https://stackoverflow.com/questions/57816914/exclamation-mark-in-type-definition – Michael Liu Jan 14 '23 at 18:42

0 Answers0