Quantcast
Channel: Two if conditions or one if with OR - Stack Overflow
Viewing all articles
Browse latest Browse all 10

Answer by Bert Heesbeen for Two if conditions or one if with OR

$
0
0

Too bad not everyone sees the difference between an Or (|) and a Condional Or (||). If in the second snippet an Or is used, there is no difference (both conditions are evaluated). Using a Conditional Or, means if the first condition (from left to right) is true, the next isn't even evaluated.

This is a very usefull feature.


Viewing all articles
Browse latest Browse all 10

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>