4 ms·
There is a followup article "Don't Make Javascript Equality Look Worse Than It Is" "These posts are fundamentally right about == being poorly designed... but t
by dustingetz 12y ago
There is a followup article "Don't Make Javascript Equality Look Worse Than It Is"
"These posts are fundamentally right about == being poorly designed... but they make things look worse by failing to organize the table.... What a mess! But most of the mess is because of the order of values in the table. By grouping equal values together, you get something more sensible"
http://strilanc.com/visualization/2014/03/27/Better-JS-Equality-Table.html http://strilanc.com/visualization/2014/03/27/Better-JS-Equal...
- anonfunction 12y agoAmazing how the same data does make more sense visually when ordered this way but still not compared to ==='s straight line. The author linked to a jsfiddle that I changed to use the same colors as the original table and improved the legibility a bit which you can find at http://jsfiddle.net/4c5z60qg/ http://jsfiddle.net/4c5z60qg/ or view as an image here: https://i.imgur.com/assIoqN.png https://i.imgur.com/assIoqN.png
- robocat 12y agoYou can make it look prettier, but it doesn't make the underlying problem any clearer. For example, few people would immediately be able to know where place the following into the table so that it still looked good: ['Infinity'] '0e1' ['infinity'] '0X0' [false] ["+0.e4"] [[[[1.,]]]] and so on :) (A bit more time, and I could probably come up with even stranger examples).