Aptitude | JavaScript Course Quiz 3 | Question 10

What will be the output of the following code?

filter_none

edit
close

play_arrow

link
brightness_4
code

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

chevron_right


(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



My Personal Notes arrow_drop_up


Article Tags :

1


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

About immukul

Executive Software Developer at Cavisson Systems