deleted by creator
by not ever using == and !=, but only === and !==
Because in reality you’re not doing stupid stuff like that in the image. And using Typescript definitely helps.
However I’m always annoyed that the month parameter when constructing a date object is 0 based. So 1st of Jan is
new Date(2024, 0, 1)
deleted by creator
Looks confusing at first, but I found it nice for accessing a month array.
const months = ["Jan", "Feb", ...]; months[0] === "Jan"; const label = months[date.getMonth()];
Typescript :)
Yep. It’s the only reason I’m still somewhat sane.
I got by without it for years, but not that I have it I have no idea how I did it back then.
By banishing the bad part of the language with linter.
For instance, standard eslint preset has rules that enforce usage of
===
, https://eslint.org/docs/latest/rules/eqeqeqThese rules often come with project starter template
And typescript is basically just a linter on steroids
almost forced to for web front end. why you would use it anywhere else, however, i will never know
Ikr? English is hard /s
JS devs should have a font that turns == into ≈.
cries in PHP
I also came to represent my php breathren.
I wish the assignment operator wasn’t the equal sign.
In Haskell, it’s the same as the mathematical
=
symbol.
parseInt(0.00000000005)
5
classic
Mathematica also has an
===
operator. And:=
.It’s also very language specific, like Pascal/Delphi also have “:=” for assignments and “=” for comparison, etc
That makes much more sense than the other way.
What does the walrus operator do?
I think it’s called ‘delayed assignment’. So it is almost like
=
, but you can use arguments to define functions,f[a_]:=a+2
.
it depends on what your definition of is is
As a backend developer i still dont know a shit what that means
In javascript, === does not perform type coercion when checking for equality
Because in JS:
1 == "1" // true 1 === "1" // false
Don’t forget that
_.isFinite('1')
returns true ;)1 + false ? (I have no idea in which order JS would evaluate things as I rarely have to touch that language much anymore)
I’m JavaScript developer. I love coding WebApps. JS sucks💩.
Any Verilog devs?