Open In App

Aptitude | JavaScript Course Quiz 3 | Question 10

Like Article
Like
Save Article
Save
Share
Report issue
Report

What will be the output of the following code?




<script>
 document.write(NaN == NaN);
</script>


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


Answer: (B)

Explanation: Equality operator (== and ===) cannot be used to test a value against NaN. Use Number.isNaN() or isNaN() instead.
Hence, it is not equal.

Quiz of this Question


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