Aptitude | JavaScript Course Quiz 3 | Question 8

What will be the output of the following code?

filter_none

edit
close

play_arrow

link
brightness_4
code

<script>
document.write(( true + false ) > 2 + true );
</script>

chevron_right


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


Answer: (B)

Explanation: Here, True will change to 1, and False to 0.
Hence, (1+0)>(2+1) => 1>3 is False.

Quiz of this Question



My Personal Notes arrow_drop_up


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.

About immukul

Executive Software Developer at Cavisson Systems