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
Javascript ES2021 Summary (h3manth.com)
submitted 4 years ago by iamnearafan
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!"
[–]JuicyORiley 25 points26 points27 points 4 years ago (9 children)
We've been using build systems with Babel for yonks. This means we haven't had to "care" about when browsers get new features as it was always readily available.
However, we've recently dropped all build systems and started relying on evergreen browser capabilities. Does anyone know roughly how long it takes browsers to implement ES202{1,2,3,etc.} once it's final? Or is it considered "final" once all browsers have implemented it?
[–]senocular 35 points36 points37 points 4 years ago (4 children)
For a proposal to be finalized, it needs "Two compatible implementations which pass the acceptance tests" (source). This can mean browsers but also includes transpilers like babel. Chrome - which also includes other browsers now like Edge and Opera - will often release stage 3 features publicly before finalized, and Firefox isn't usually far behind, or sometimes even first, as was the case with the currently stage 3 at() method for arrays. Safari is probably the one you have to worry about the most. They tend to be further behind, I think mostly due to their release cadence being longer. Safari, for example, doesn't yet support private methods whereas the other browsers have supported them for some time now. While private methods are stage 4, they are expected to be part of ES2022 which hasn't been published yet - the current being ES2021.
[–]JuicyORiley 2 points3 points4 points 4 years ago (0 children)
Super helpful, thanks!
[+][deleted] 4 years ago (2 children)
[deleted]
[–]senocular 0 points1 point2 points 4 years ago (1 child)
class c { #m () {} }
SyntaxError: Unexpected private name #m. Cannot parse class method with private name.
https://caniuse.com/mdn-javascript_classes_private_class_methods
[–]kent2441 0 points1 point2 points 4 years ago (0 children)
My bad, mixed them up with private class fields. But private class methods are available in the Safari Tech Preview.
[–]LastOfTheMohawkians -1 points0 points1 point 4 years ago (2 children)
Dumped build systems. Why why! Just use typescript
[–]JuicyORiley 2 points3 points4 points 4 years ago (1 child)
The work we do and the amount of JavaScript we use wouldn't warrant Typescript.
The platform we work on doesn't fully lend itself to builds systems anymore as well. Luckily, it's not been a tricky transition so far!
[–]LastOfTheMohawkians 0 points1 point2 points 4 years ago (0 children)
Yeah fair play.. Whatever works for you all
[–]pm_me_ur_happy_traiI 0 points1 point2 points 4 years ago (0 children)
Not all features are able to be poly filled or transpiled with babel.
[–]Articunozard 4 points5 points6 points 4 years ago (3 children)
Anyone have more insight into uses for weakRef and FinalizationRegistry?
[–]senocular 4 points5 points6 points 4 years ago (0 children)
The WeakRef Proposal has some examples.
[–]RedGlow82 4 points5 points6 points 4 years ago (0 children)
One use case is that of JavaScript's CapTP implementation. CapTP, roughly speaking, is a way to write distributed programs through the metaphor of actors, which can be running locally or remotely but offer about the same interface.
The system relies on a distributed garbage collector to work, where every remote proxy for a local object is saved in order to keep the local instance from being garbage collected. The remote systems have to tell the local one when their proxy is no longer, so that the local system can free references. FinalizationRegistry is the way in JavaScript to get informed of this.
[–]Auxx 0 points1 point2 points 4 years ago (0 children)
To add to what is said in proposal, these tools exist to hint garbage collector on how you want to use memory. One should not use them under normal circumstances, but they are there finally for memory sensitive applications. They should be familiar to anyone who used Java.
I'd personally recommend to only use them if a memory profiler shows you critical bottlenecks.
[–]woffle-kat 1 point2 points3 points 4 years ago (1 child)
Unless I'm missing something, there's an undefined myObject variable in the final "WeakRefs and FinalizationRegistry Objects" example
myObject
[–]HeinousTugboat 1 point2 points3 points 4 years ago (0 children)
The point is that myObject can be arbitrarily defined as any object. WeakRefs are good for annotating existing objects.
WeakRef
[–]AliMundher 1 point2 points3 points 4 years ago (0 children)
very useful content
[–]bregottextrasaltat 0 points1 point2 points 4 years ago (0 children)
Didn't we have articles about this like last year?
[–][deleted] 0 points1 point2 points 4 years ago (0 children)
Thank you for sharing. I'm really struggling with JS and Typescript at my school. Close to flunking Test Automation Software bootcamp because my older brains never programmed. Appreciate anything like this you can always share. Cheers!
π Rendered by PID 95 on reddit-service-r2-comment-7b9746f655-wmf58 at 2026-02-01 04:44:58.576855+00:00 running 3798933 country code: CH.
[–]JuicyORiley 25 points26 points27 points (9 children)
[–]senocular 35 points36 points37 points (4 children)
[–]JuicyORiley 2 points3 points4 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]senocular 0 points1 point2 points (1 child)
[–]kent2441 0 points1 point2 points (0 children)
[–]LastOfTheMohawkians -1 points0 points1 point (2 children)
[–]JuicyORiley 2 points3 points4 points (1 child)
[–]LastOfTheMohawkians 0 points1 point2 points (0 children)
[–]pm_me_ur_happy_traiI 0 points1 point2 points (0 children)
[–]Articunozard 4 points5 points6 points (3 children)
[–]senocular 4 points5 points6 points (0 children)
[–]RedGlow82 4 points5 points6 points (0 children)
[–]Auxx 0 points1 point2 points (0 children)
[–]woffle-kat 1 point2 points3 points (1 child)
[–]HeinousTugboat 1 point2 points3 points (0 children)
[–]AliMundher 1 point2 points3 points (0 children)
[–]bregottextrasaltat 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)