0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

お母さんでもわかる演算子

Last updated at Posted at 2023-05-03

論理積

item = ex1 && ex2
ex1の評価がtrueの場合はex2を返し、それ以外の場合はex2を返す。

論理和

item = ex1 || ex2
ex1の評価がtrueの場合はex1を返し、それ以外の場合はex2を返す。

条件演算子

item = condition ? ex1 : ex2
conditionを評価し、trueの場合はex1を、falseの場合はex2を返す。

合体演算子

item = expr1 ?? expr2
expr1の評価がnullまたはundefinedの場合はexpr2を返し、そうでない場合はexpr1を返す。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?