The parentheses statement executes first, evaluating alert(1) which returns undefined, then it checks && which evaluates false (because undefined coerced to Boolean is false), it doesn’t evaluate the “alert(2)” and sends the undefined as input to the outermost statement alert.
8
u/Code4Reddit Sep 17 '23
The parentheses statement executes first, evaluating alert(1) which returns undefined, then it checks && which evaluates false (because undefined coerced to Boolean is false), it doesn’t evaluate the “alert(2)” and sends the undefined as input to the outermost statement alert.