know the features of your language
know the features of your language
know the features of your language
You're viewing a single thread.
What if both are null
Then null will be returned, as the value of b.
What is null is null?
True
Normally the purpose of a block of code like this is to provide a fallback hardcoded value if the dynamic value from your API or whatever is null. Like, setting a default title for a page of a notes app if the user didnt set a title themselves etc.
So, b is very likely to be a never-null, hardcoded value.
This code can still be valid and return null if b is null too, as the other person said.