Open In App

Aptitude | JavaScript Course Quiz 3 | Question 6

Like Article
Like
Save Article
Save
Share
Report issue
Report

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


Last Updated : 10 May, 2019
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads