I’ve spent about 1.5 years learning python. Only in a few cases have I encountered a situation where I needed to use strict comparison. Maybe this is because I tend to be deliberate about how I use certain datatypes, or maybe it’s just because I have limited experience.
The more commonly-used abstract comparison (e.g. == ) converts the operands to the same type before making the comparison.
Thanks for the link! I misunderstood the strict comparison. I was thinking that “===” was something like the “is” keyword from Python. Now I see they’re totally different. is checks to see if the evaluated object is identical to the instance being compared.
Wow. Automatic type conversion… that might make debugging a little crazy. No wonder they use === for comparison! Is there a way to enforce/coerce the type to which an expression evaluates? Kind of like int(), str(), bool() or float()?
Anyhow… I’ll make sure to use the strict comparison in JS.
(Note: W3School had a bad reputation amongst “professional programmers” a while ago. I didn’t found any reason why. W3School helped me a lot. The easy but not simplistic explanations explain often heavy topics in a very understandable way. And in fact because of this the other ressources had to keep pace with it. So I found that MDM (Mozilla) worked hard in the last years to make their docs readable. W3School has also a very good intro to Python. You can read something on Python.org and then go to W3School and understand it )
MDN is the most reliable and complete resource you will find on the internet when it comes to JS.
W3School is good enough but it doesn’t cover all the details. It’s heavy on examples, easy to understand, I agree. It is very good for a beginner, but as you grow as a dev you will find it insufficient.
So for advanced techniques and info always go to MDN.
I think MDN did a huge amount of hard work to gather it all in one place: JS, JQuery, the DOM, accessibility guidelines, anything web development plus Firefox dev tools, which are the best ( much better than Chrome ones)
Yes thats true. But I like it to have different ressources, because I don’t always understand the first explanation in one place. It is sad enough that the WebPlatfform.org had to die https://webplatform.github.io/ it was a very ambitious project from Google, Apple, Microsoft, Facebook, etc. and had a very interesting start. But I think it’s dead strenghtened the MDM Platform.
One thing I recognised over the year is, don’t be to much attached to a tool. I was always on the search for the bestsuper tool. But I found that it doesn’t exist (by the way Vim is very close ). There is always some feature a other tool has that is better for some kind of stuff. I also think that the Chrome dev tools does some things better than Firefox so I use it in the particular case the only thing is that you always have to deal with other commands and stuff and don’t get the work done as quickly as you like … Even Edge and Safari has sometimes good stuff
Hey, @DidierCH the best way to learn it, like Zed thought us is code code code and repeat.
After completing the JS book, all the exercises, all the vids , go in the wild and do small things.
Here’s an example of a small thing: world countries by continent using a REST API: https://codepen.io/ioiomano/pen/mMGwZa.
It was an exercise I received while doing that internship and I did quite a few of those.
It really helps.
Spoiler alert: my codepen sucks, it’s full of unfinished drafts, lol.
I think everyone here has you covered @austen, but I think of == as “probably equal” and === as “definitely equal”. There becomes a big problem when you get into inequality like < and > since there isn’t an equivalent too (AFAIK). That makes all the safety savings you get from === only slightly good since there’s plenty of other ways you can mess up < or > comparisons too.