One of the quiz answers seems incorrect, afaict
What does
[] && 2 < 3
return?
- It causes an error.
[]
true
false
EXPLANATION
This operation is an inversion of the previous. It also does not short-circuit, and the expression
2 < 3
(which evaluates totrue
) is the last operand evaluated.
This questions asks what it returns, not what it evaluates to. So the correct answer, afaict, should be “2<3”. But that isn’t an option, and “true” is what you have to pick to get the question marked correct. As supporting evidence, the previous question is the same thing but with the order reversed and the correct answer being “[ ]”.