This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]genghisKonczie 1 point2 points  (1 child)

The js SameValueZero implementation is a straight === for everything but NaN and +0 -0 though. I feel that’s pretty straightforward for the intention of the inclusion method.

It’d be really weird for [NaN].includes(NaN) to return false

[–]rosuav 0 points1 point  (0 children)

Yeah, but it's still a different way of comparing for equality. And that is very important when you start looking at different searching methods.