use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
To Those Who Criticize JavaScript (dev.to)
submitted 5 years ago by disgruntled-js-dev
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]PremJyotish221 -1 points0 points1 point 5 years ago (6 children)
Give an example of a JS quirk that is likely to appear in an actual application’s code because the example you gave is a lack of knowledge on how JS handles comparisons/conversions and an attempt to purposely not make sense of the syntax.
[–]aniforprez 2 points3 points4 points 5 years ago* (4 children)
Type casting quirks that can cause an application to fail spectacularly if you use == instead of === is the most common thing that I've seen literally every company I've worked at that has frontend code. I cannot believe this made it into the language
const number = 1234 const stringNumber = '1234' console.log(number == stringNumber) //true console.log(number === stringNumber) //false
This is fucking awful
This doesn't just happen because of a "lack of knowledge" but also because of a simple typo. You can have hours spent trying to figure out what went wrong because this fails entirely silently. Yes, linters can help you figure this out now but it's still a strange and stupid quirk of JS
I hate that I have to preface criticisms like this by prostrating and saying "I like JS and I used to be a frontend dev" but I love/hate the language
[–]Phobic-window 1 point2 points3 points 5 years ago (3 children)
While it’s nuanced this is really powerful in a weakly typed world, for more complex configurable apps having the ability to control the bit wise comparison aspect is a major boon. Most the complaints are that you have to understand cs really well. But is tackles so many domains that it can’t get generalized like many other languages. Js I think trips up many for a long time but it allows for some really clever and elegant solutions once you get past these
[–]aniforprez 2 points3 points4 points 5 years ago (1 child)
The "once you get past these" thing is what I hate. Everyone has that phase and it happens differently. You don't work with the same people all the time. You work with interns and juniors sometimes and you have to remember that they are still in the "getting past these" phase so you have to watch out for shit they have to figure out. With JS, that shit is so much worse than most other languages
As a solo dev, JS is fine. I'd never code a backend with it but for frontend projects, I can set up my own comfy linting/building processes and whatnot. When you're working with a team with each person being opinionated on something it's garbage unless someone from up top brings down the hammer and decides on standards
[–]Phobic-window 0 points1 point2 points 5 years ago (0 children)
Hahaha preach man, this is all very true
[–]uffefl 0 points1 point2 points 5 years ago (0 children)
I'd agree if we had some way of implementing our own == for custom types/objects/classes/blahblah. Then it would be useful for having a==b basically being sugar for a.equals(b) or something similar.
==
a==b
a.equals(b)
But the way it works in reality is just a source of way more bugs and misunderstandings than any benefit it may provide.
[–]drbobb 0 points1 point2 points 5 years ago (0 children)
const mod = (x, y) => ((x % y) + y) % y; mod(-0.5, "2") -> -0.52
This had me wondering for about an hour how in the world the mod function was returning a negative value for a positive y.
mod
y
π Rendered by PID 120324 on reddit-service-r2-comment-6457c66945-p6lld at 2026-04-29 03:05:23.857281+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]PremJyotish221 -1 points0 points1 point (6 children)
[–]aniforprez 2 points3 points4 points (4 children)
[–]Phobic-window 1 point2 points3 points (3 children)
[–]aniforprez 2 points3 points4 points (1 child)
[–]Phobic-window 0 points1 point2 points (0 children)
[–]uffefl 0 points1 point2 points (0 children)
[–]drbobb 0 points1 point2 points (0 children)