hey_janry
hey_janry

Reputation: 223

When can obj !== obj be true?

I want to know when obj !== obj can be true?

This is what I saw a line of code in the book, I was very puzzled.

var result = class2type[(obj == null || obj !== obj)] ? obj : toString.call(obj) ] || obj.nodeName || "#";

Upvotes: 5

Views: 71

Answers (1)

p.s.w.g
p.s.w.g

Reputation: 149040

The one case that pops to my mind is NaN:

console.log(NaN !== NaN) // true

Upvotes: 11

Related Questions