What does the exclamation mark do in TypeScript

0 votes

When looking at the sourcecode for a tslint rule, I came across the following statement:

if (node.parent!.kind === ts.SyntaxKind.ObjectLiteralExpression) {
    return;
}

Notice the ! operator after node.parent?

What is it and how does it work?

May 31 in TypeSript by Logan
• 2,140 points
127 views

1 answer to this question.

0 votes
The exclamation mark is called the non-null assertion operator. The type checker sometimes does not work so you can include this explicitly.
answered Jun 1 by Nina
• 3,020 points

Related Questions In TypeSript

0 votes
1 answer
0 votes
1 answer

What is the question mark for in a Typescript parameter name?

It is to mark the parameter as optional. TypeScript ...READ MORE

answered Aug 3 in TypeSript by Abhinaya
• 760 points
14 views
0 votes
1 answer
0 votes
1 answer

What does <T> do in TypeSript?

This is a TS Generics declaration. T will be declared ...READ MORE

answered May 31 in TypeSript by Nina
• 3,020 points
14 views
0 votes
1 answer

How to set meta tags using Angular universal SSR and ngx-seo plug-in?

first Install the plug-in with npm i ngx-seo ...READ MORE

answered Feb 11 in Others by narikkadan
• 11,280 points
709 views
0 votes
1 answer

How to use next-seo for setting nextjs meta tag with multiple OGP images?

https://github.com/garmeeh/next-seo use this git repo that contains ...READ MORE

answered Feb 24 in Others by narikkadan
• 11,280 points
437 views
0 votes
0 answers

how to sign bitcoin psbt with ledger?

I'm trying to sign a PSBT transaction ...READ MORE

Mar 9 in Blockchain by Soham
• 8,740 points
262 views
0 votes
0 answers

Can't bind to 'ngModel' since it isn't a known property of 'input'

I have this  input in my component ...READ MORE

Apr 29 in Other DevOps Questions by Kichu
• 19,040 points
144 views
0 votes
1 answer

What does the @ (at sign) sign do in TypeScript?

The big news this week is the ...READ MORE

answered Jun 10 in TypeSript by Nina
• 3,020 points
23 views
0 votes
1 answer

Now I know what 'pick' does. But I want to do the opposite and remove values from an object.

You can use the keyword Omit for ...READ MORE

answered May 27 in TypeSript by Nina
• 3,020 points
20 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP