2021-06-15から1日間の記事一覧
Null合体演算子(??) 左辺がnullかundefinedであれば、右の値を返し、そうでなければ、左の値を返します。 [使いどころ] 変数がnullやundefinedだった時に初期値を入れることができる。 const a = null ?? 'nullかundefinedです'; const b = undefined ?? 'nu…
Null合体演算子(??) 左辺がnullかundefinedであれば、右の値を返し、そうでなければ、左の値を返します。 [使いどころ] 変数がnullやundefinedだった時に初期値を入れることができる。 const a = null ?? 'nullかundefinedです'; const b = undefined ?? 'nu…