1
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?

|| 論理演算子でこれを使う場合

Posted at
 || 

の場合を考察

「||」はプログラミングではまたはを意味する

Aが真 || Bが偽

の場合はAが真のため条件全体はtrue

Aが偽 || Bが真

こちらもBが真であるためtrueが返る

A,Bどちらも真の場合はもちろんtrue
A,Bどちらも偽の場合はもちろんfalse

このように「||」は右辺か左辺のどちらかが真であれば条件全体がtrueとなる

1
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
1
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?