What will be the output of the following code?
<script> document.write((0 && 1) || (1 || 0));
</script> |
(A) 0
(B) false
(C) true
(D) 1
Answer: (D)
Explanation: The && (and operator) returns the last (right-side) value as long as the chain is “truthy”. The || (or operator) returns true if either of the value is true.
Quiz of this Question
Article Tags :
Recommended Articles