Question: I found a way to write the `if` statement in another way (I think) while searching in the source code of a website.

Instead of:

```
if(a)b;

```

or:

```
a?b:'';

```

I read:

```
!a||b;

```

Is the third way the same as the first two? And if yes, why we would use the third way?

Answer: 
The third way is the same as the previous ones. One argument to use it is saving bytes. A strong argument against using it is readability. You'd better focus on readability in writing code, and use a minimizer (such as [Google Closure Compiler](http://closure-compiler.appspot.com)) to save bytes.

It can be even shorter:

```
a && b;
/*  !a||b  means:
 (not a) OR b
    which is equivalent to
 a AND b
    which turns out to be
 a && b
*/

```
The result of the boolean expression sometimes can be evaluated without evaluating all the sub-expressions. If we have `A||B`, and `A` is true there's no need to even evaluate `B`, because the result will be true anyway. This behavior is called "shortcut boolean evaluation" and is defacto standard in most programming languages. It allows to write expressions like `if (i < A.length && A[i] == ...)` without evaluating the `A[i]` operand which can lead to an exception if `i` value is incorrect.

In this particular case, `!a||b` is the same as `if(a)b`, yes, but the readability and maintainability of such code is a question though.