method?: string | undefined;
what is the meaning of this line in javascript
I tried interpreting it as a conditional operator with null assigned to the method in case it has true boolean value
But this is not correct
>Solution :
It’s not JavaScript, it’s TypeScript (probably). It’s not a single operator, it’s:
- The
?marker indicating that the property or function parameter is optional (optional properties, optional parameters) - The
:that starts the beginning of a type annotation