#Question regarding the `?` operator

12 messages · Page 1 of 1 (latest)

sudden linden
#

hi, will bar be ran if foo is null?

foo?.bar()
surreal egret
#

(if foo is null, bar will not exist anyway)

sudden linden
#

I see

#

thank you

#

what happens if you refer to a variable?

#

will it default to js behavior (undefined/null) or will something else happen?

balmy flame
#

TS doesn't change how ?. behaves.

sudden linden
#

thanks

#

how do I mark this question as resolved?

surreal egret
vale reefBOT
#

@sudden linden
Because your issue seemed to be resolved, this post was marked as resolved by @surreal egret.
If your issue is not resolved, you can reopen this post by running !reopen.
If you have a different question, make a new post in #1057653400046674112.