Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Web technologies Questions | JavaScript Course Quiz 2 | Question 4

  • Last Updated : 10 May, 2019

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

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!