Open In App

Web technologies Questions | JavaScript Course Quiz 2 | Question 3

What will be the result of the following code?




<script>
  document.write( true && 1 && 3);
</script>

(A) 0
(B) 1
(C) true
(D) 3

Answer: (D)
Explanation: The && (and operator) returns the last (right-side) value as long as the chain is “truthy” or True.
Quiz of this Question

Article Tags :