5*3===3*5 returns true in javascript. #justsaying
Miles Berry
375

But [3, 3, 3, 3, 3] === [5, 5, 5] returns false, which is the point the author is trying to make. You could of course argue that [3] === [3] also returns false in JavaScript, which is because the two arrays aren’t identical (i.e. a reference to the same thing in memory) but instead are two different arrays which just happen to look alike. The solution is to use a deep equals function:

deepEqual([3, 3, 3, 3, 3], [5, 5, 5])

which also returns false.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.