- cross-posted to:
- [email protected]
TL;DR do not use
==Common practice since forever
most linters since like jshint as well catch it
It’s so crazy to me that they convert from string to int and not the other way round.
if you hate JS and think it’s dumb, but still have to use it, look into Eloquent Javascript (free) https://eloquentjavascript.net/ and the mozilla docs https://developer.mozilla.org/en-US/docs/Web/JavaScript.
Eloquent JS is written by someone who also hates JS, but understands it very well.
I used them while I worked on the Microtonal Music Grid (still in progress)
Having worked with JavaScript, I understand the usefulness of a “less strict” equality comparison like this, but the coercion of objects still does my head in…
(And for the record, most of the time I did use strict equality).
Just use
===






