We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
user?.id
user
null
user.id
user ??= User()
User()
expr1 ?? expr2
expr1
expr2
The text was updated successfully, but these errors were encountered:
No branches or pull requests
概要
user?.id
でuser
がnull
のときuser?.id
もnull
を返す.user.id
だともしuser
がnull
のときエラーが発生する.user ??= User()
は,user
がnull
のときは,User()
を代入する式expr1 ?? expr2
は,もしexpr1
が非nullのときはその値を返す;そうでなければ、expr2
を計算して返す。The text was updated successfully, but these errors were encountered: