Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のコードを使用してみましたが、私が知る限り、最初の 2 つの変数のみをチェックします。
if (var1 || var2 || var3) { // Do something. }
誰も言及していませんでした:
|- バイナリ OR ||- 論理 OR
|
||
仮定しましょうa = false b = true c=false
a = false
b = true
c=false
a || b || c== true a | b | c== 0 | 1 | 0==1論理的な「真」の値も持っています。
a || b || c
true
a | b | c
0 | 1 | 0
1