Dart ??=

hur-kyuh-leez·2023년 1월 8일
0

??=

Doc:
Assignment operators

풀이:

?? 뜻이 if null 이니
= 을 붙이면 지정하여라니
합치면...
만약 null이면 xxx로 지정 하여라
a ??= 10
만약 a가 null이면 10으로 지정 하여라

ps.
int? 해석

"if you enable null safety, variables can’t contain null unless you say they can. You can make a variable nullable by putting a question mark (?) at the end of its type. For example, a variable of type int? might be an integer, or it might be null."

Mac OS Option+Cmd+L for Line reformat
L for line

profile
벨로그에 생각을 임시로 저장합니다. 틀린건 틀렸다고 해주세요 :) 그래야 논리 학습이 강화됩니다.

0개의 댓글