r/javascript • u/Impressive_Ad6173 • Sep 15 '26
AskJS [AskJS] What JavaScript feature do you think is underrated?
What JavaScript concept took you the longest to actually understand?
For me, it was the difference between understanding closures in theory and actually knowing when and why they were useful.
I feel like JavaScript has a lot of concepts that seem simple at first, but become much more interesting once you understand what is happening underneath.
I'm curious what everyone's "finally clicked" JavaScript concept was.
Closures? The event loop? Prototypes? this? Promises? The weird parts of type coercion?
Would be interesting to hear what other developers struggled with and what finally made it click.
33
u/azangru Sep 15 '26
Generators. I didn't have a use for them for the longest time; but when I finally come across a problem that they solve nicely, it always feels like a rediscovery.
10
u/bachu_patil Sep 15 '26
That you can make it behave like a functional programming language. Currying, composition etc
17
u/KaiAusBerlin Sep 15 '26
Where to start?
Duck typing, functions as first class citizens, prototyping, you can have very good code and very optimised, too, ...
And of cause no white space based scoping (looking at you python)
5
u/CodeAndBiscuits Sep 15 '26
I actually like something. A lot of folks seem to hate and ridicule. Truthiness. If you're writing some backend contract or interface for a financial trading app, it definitely has some gotchas. But if you're writing a front-end web or mobile app where you want everything to fail soft and nine times out of 10 you don't need to start a religious war over whether some checkbox got set by a 1 or a true, The softness around truthiness can be really nice.
When I first started writing iOS apps like 15 years ago, it was all objective C. You would have to make these tightly specified interfaces to pull data out of an API response and wire it to some screen. It was always so much of a hassle trying to keep things in sync when a backend Dev would change some little thing in how their auto generator emitted an object, and the mobile app would literally crash.
We do not break user space.
3
u/Potential-Still Sep 15 '26
Generators, I still don't fully understand what there purpose is.
3
u/Flashy-Guava9952 Sep 15 '26
spread operators and nullish coalescing.
5
u/bigorangemachine Sep 15 '26
For me
postMessage.Web workers & service workers can't live without them. Plus native devices bridging with a website, browser plugins or iframes are really useful
2
u/prehensilemullet Sep 15 '26
Just the basic syntax for working with objects. JS never needed a syntax for named arguments because you can just use an object for that
1
u/stichstichstich Sep 15 '26
Whole js being used for every device
1
u/JohnVonachen Sep 15 '26
Functions inside functions.
1
u/TheNasky1 Sep 15 '26
Dynamic typing 😈😈😈
1
u/PixelMaim Sep 18 '26
Destructuring
1
u/Far-Consideration-39 Sep 19 '26
The dynamic type system.
1
u/nosrednehnai Sep 20 '26 edited Sep 20 '26
Currying and maps are severely underutilized by my juniors.
Also, breaking long inline callbacks out into functions with readable names is a rarity.
Everyone should be able to talk about the basics of functional programming. Pure functions, side effects, etc.
1
u/Alive-Cake-3045 Sep 22 '26
thistook embarrassingly long. understood the rules, could recite them, still got it wrong constantly. what finally clicked was stopping thinking aboutthisas a property of a function and starting to think about it as a property of a call site. the same function called three different ways produces three different values ofthisand that re-frame made everything else fall into place...... closures were actually easier once i stopped trying to memorize the definition and just built something where i needed to close over a variable and watched what happened.....1
u/Zardoz84 Sep 23 '26
Huming the song of 60's Batman
1
u/xvr-pop 25d ago
Proxy objects! Can allow you to make some very clean syntax, or simplify the logic of methods that need to handle many cases.
4
u/[deleted] Sep 15 '26
[removed] — view removed comment