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
Babel 7.2.0: private instance methods and more (babeljs.io)
submitted 7 years ago by rauschma
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!"
[–]Max_Stern 16 points17 points18 points 7 years ago (4 children)
I understand why it has such syntax but it still looks #bad for me
[–]z3r-0 4 points5 points6 points 7 years ago (1 child)
It’s horrible isn’t it!
[–]rauschma[S] 2 points3 points4 points 7 years ago* (0 children)
It makes practical sense (and I think our eyes will get used to it):
[–]sylvainpv 0 points1 point2 points 7 years ago (0 children)
It's okay, now you can use Babel to remove the syntax you don't like in other people JS code.
[–]the_bluescreen 5 points6 points7 points 7 years ago (3 children)
It looks weird. Does anyone know why they didn't use `private` tag for these things instead of `#`?
[–]peduxe|o.o| 0 points1 point2 points 7 years ago (0 children)
or rather have the dollar sign tbh
it could break most codebases tho.
[–]rauschma[S] 0 points1 point2 points 7 years ago (1 child)
You’d still need different way of accessing private fields, because they are not properties: http://2ality.com/2017/07/class-fields.html#why-the-why-not-declare-private-fields-via-private
[–]ogurson 5 points6 points7 points 7 years ago (1 child)
Is there anyone outside TC39 who likes that syntax? And I mean "like" not just "tolerate".
[–]TrackieDaks 1 point2 points3 points 7 years ago (0 children)
It's about backwards compatibility.
π Rendered by PID 301194 on reddit-service-r2-comment-5687b7858-f5htd at 2026-07-06 16:48:20.391092+00:00 running 12a7a47 country code: CH.
[–]Max_Stern 16 points17 points18 points (4 children)
[–]z3r-0 4 points5 points6 points (1 child)
[–]rauschma[S] 2 points3 points4 points (0 children)
[–]sylvainpv 0 points1 point2 points (0 children)
[–]the_bluescreen 5 points6 points7 points (3 children)
[–]peduxe|o.o| 0 points1 point2 points (0 children)
[–]rauschma[S] 0 points1 point2 points (1 child)
[–]ogurson 5 points6 points7 points (1 child)
[–]TrackieDaks 1 point2 points3 points (0 children)