The statement &&internally coerces the expression values to boolean, but the result of the statement is always the actual, inconsistent value of the first expression that failed (i.e. it was false).
Therefore, it (true && undefined)will result in undefined, because it is truenot false. Similarly, it (true && 0)will evaluate the value 0.
source
share