JavaScript Conditions Using || and && short circuiting

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

The Boolean operators || and && will "short circuit" and not evaluate the second parameter if the first is true or false respectively. This can be used to write short conditionals like:

var x = 10

x == 10 && alert("x is 10")
x == 10 || alert("x is not 10")


Got any JavaScript Question?