So this is the pic
so as you can see why do I have to use the dot operator after trying to do the optional chaining ?
I tried to exclude it but then it shows error.
Any help is appreciated.
So this is the pic
so as you can see why do I have to use the dot operator after trying to do the optional chaining ?
I tried to exclude it but then it shows error.
Any help is appreciated.
That's how the syntax was specified.
Why? Because without the dot, the ?
is ambiguous and could the the begin of a conditional operator expression (… ? (…) : …
) instead. To make parsing easier (not having to lookahead and find a matching :
), the dot that immediately follows the question mark is required.