i would think this is simple...
if
, declared first, how can
be truthy?
Code:
let a = 0; // declare the variable a and assign the value of 0<< 0
false && (a = 1); // (a = 1) is truthy, but it won't be evaluated, since the first operand is false<< false
a // the value of a is still 0<< 0
false || (a = 1); // this will evaluate both operands, so a will be assigned the value of 1, which is returned<< 1
if
Code:
a = 0
Code:
a = 1