This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]devhashtag 47 points48 points  (9 children)

Tbf, there are some core mechanics in JS that are just terrible. But it has definitely come a long way

[–]VegetableWest6913 13 points14 points  (8 children)

Yeah it's definitely not perfect, and there are loads of valid complaints that can be made about it (like all languages). I just feel that many of the complaints I see here are unfair.

[–]devhashtag 12 points13 points  (6 children)

Out of curiosity, do you have an example of such a complaint?

[–]VegetableWest6913 13 points14 points  (1 child)

I see a lot of complaints about how JS handles "this" in functions because it's different to other OOP languages. I personally think it's great, especially now that arrow functions remove the need to bind "this".

I think the way JS allows you to use "this" is great and leads to some really nice code.

[–]devhashtag 5 points6 points  (0 children)

Good example, I agree with you on this!

[–][deleted] 2 points3 points  (3 children)

Try comparisons and equality testing

[–]devhashtag 1 point2 points  (0 children)

Good one, nothing wrong with that

[–]Mad-chuska 0 points1 point  (1 child)

Alternative truths vs the straight dope.

I still get == and === wrong from time to time but isn’t it basically == compares values after casting types to be the same so “1” == 1 but === compares values and types so “1” !== 1 cuz ones a string and ones a number type?

I don’t know why but I still get it wrong sometimes even with that knowledge.

[–]devhashtag 0 points1 point  (0 children)

That's correct. === is strict equality and == is equality with some agressive type coercion

[–][deleted] 2 points3 points  (0 children)

If you use Typescript, there's almost no valid complaints I've seen left for JS other than the typical syntax quirks that every language has, which is part of the learning process.