e.g. a += b! - c!;
I saw several expressions like this but I can't find what it's called or what it does
Asked
Active
Viewed 2,460 times
3

Moisés Icaza
- 31
- 3
-
1It’s the [non-null assertion operator](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-0.html#non-null-assertion-operator) – Linda Paiste May 26 '21 at 14:18
1 Answers
4
you're telling the compiler that even though judging purely by the code, the variable could be undefined, you, the programmer, know for 100% sure that it will have a value, so you're not going to do a check to see if it has a value or not.

Bart van den Burg
- 2,166
- 4
- 25
- 42