JavaScript is non-strictly typed language as Java,for example.
As we know, it converts value of result dependently upon context:
\"2\" + \"3\" r
To quote MDC;
&&; Returns expr1 if it can be converted to false; otherwise, returns expr2. Thus, when used with Boolean values, && returns true if both operands are true; otherwise, returns false.
||; Returns expr1 if it can be converted to true; otherwise, returns expr2. Thus, when used with Boolean values, || returns true if either operand is true; if both are false, returns false.
So in the first example, 1 is being returned because expr1 cannot be converted to false.
In the second example, true can be converted to true, so it's returned.