News for hackers. Stuff that matters.
Re:The Evil Within the Comparison Functions by SFjulie1 on Sunday February 18, 2018 @06:20PM (#16409501)
Oh I thought it was about JS insanity.

Well known caveats : don't use == but ===.

What about cmp implicit operator in js?

Well, it relies on == :)

same with lt/gt

"0" === 0 false "0" < 0 false

"0" <= 0 true "0" > 0 false

WTFOMGBBQ?!!!!

The implicit type conversion mess is all over the place in JS. Changing == to === is by far not sufficient.

"<==", "==>", "truecmp" would be required to correct a tad the mess still. More correct solution would be to burn JS to the ashes at my opinion, with emacs, modern hardware, devops and startups

There are no comments on this comment yet.