Hi @designslayer73591,

You have stumbled upon an interesting property of `&&`

and `||`

which is called **short circuiting** . By this property, they tend to cut down on the number of the unnecessary calculations and provide efficiency. Let us see how:

Here's the truth table for `||`

:

```
a | b | a || b
------------------------
true | true | true
true | false | true
false | true | true
false | false | true
```

As you can see, when `a = true`

, **it does not matter what the value of **`b`

may be - as the return value will be same - `true`

- whether `b`

is `false`

or `true`

. So, when you do: `a || b`

, and `a = true`

, then `||`

will simply return true **without evaluating **`b`

. Reread this again if this doesn't make sense.

It is only when `a=false`

that `b`

needs to be evaluated.

And here's the truth table for `&&`

:

```
a | b | a && b
------------------------
true | true | true
true | false | false
false | true | false
false | false | false
```

As you can see, when `a = false`

, **it does not matter what the value of **`b`

may be - as the return value will be same - `false`

- whether `b`

is `false`

or `true`

. So, when you do: `a && b`

, and `a = false`

, then `&&`

will simply return false **without evaluating **`b`

. Reread this again if this doesn't make sense.

It is only when `a=true`

that `b`

needs to be evaluated.

Can you now reason why you have got the output the way you got it in the code?

Hope it helps!