Open In App

Aptitude | JavaScript Course Quiz 3 | Question 6

What will be the output of the following code? 

< script>



document.write( 10 > 9 > 8 === true );

</ script> 



(A)

true

(B)

false

(C)

1

(D)

0

Answer: (B)
Explanation:

As humans we read the above something like, \”ten is greater than 9 which is greater than 8\”, or: (10 > 9) && (9>8) Javascript, however, is beholden to its order of operations implementation. Which causes the line to be evaluated as: ((10>9)>8) or (true>8) or (1>8) which is false.

Quiz of this Question
Please comment below if you find anything wrong in the above post

Article Tags :