| 書き方 | 名前 | 意味 | JS / TS |
|---|---|---|---|
age?: number |
オプショナルプロパティ |
age はあってもなくてもOK |
TS |
user?.name |
オプショナルチェイニング |
user がなければエラーにしない |
JS・TS |
a ?? b |
Null合体演算子 |
a が null / undefined なら b を使う |
JS・TS |
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme