! operator
1 | if (a!.b!.c) { } |
compiles to JS:
1 | if (a.b.c) { |
? operator
1 | let x = foo?.bar.baz(); |
compiles to JS:
1 | let x = foo === null || foo === undefined ? undefined : foo.bar.baz(); |
And:
1 | if (someObj?.bar) { |
is equivalent in JS to:
1 | if (someObj && someObj.someProperty) { |
TS:
1 | interface Content { |