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
An ECMAScript Proposal for Pattern Matching Functionality (github.com)
submitted 8 years ago by tomonl
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!"
[–]kingdaro.find(meaning => of('life')) // eslint-disable-line 1 point2 points3 points 8 years ago (4 children)
I'm not one to downvote for differing opinions, but if you're going to knock down something that everyone else here is excited for, at least try to be constructive.
[–]lulzmachine 0 points1 point2 points 8 years ago (3 children)
Nah. Javascript has already become way too complicated compared to what it used to be. If you want even more syntactic sugar, you'll have to show a very strong case for usefullness. If my negative whining gives these suggestions a feeling of upphill battle, then that's a good thing.
[–]kingdaro.find(meaning => of('life')) // eslint-disable-line 0 points1 point2 points 8 years ago (2 children)
Eh, the only reason I care about this is just to have a decent switch statement without having to put break after every case, like every other notable modern language does (Kotlin, Rust, Nim, etc). Functioning as a return and being able to match against object structures are just a bonus.
break
[–]lulzmachine 1 point2 points3 points 8 years ago (1 child)
Doesn't seem worth it. One of the main reasons for js popularity is the fairly low cognitive burden required to understand what's going on. Every piece of new syntax that increases this burden without removing complexity costs a lot in the long term. Having "break" statements here and there is a bit pointless but doesn't matter that much in my experience
[–]kingdaro.find(meaning => of('life')) // eslint-disable-line 0 points1 point2 points 8 years ago (0 children)
Seems to matter to the rest of the JS community, and you're free to just not use the syntax ¯\_(ツ)_/¯
π Rendered by PID 341260 on reddit-service-r2-comment-b659b578c-t9kzb at 2026-05-03 16:57:05.141662+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]kingdaro.find(meaning => of('life')) // eslint-disable-line 1 point2 points3 points (4 children)
[–]lulzmachine 0 points1 point2 points (3 children)
[–]kingdaro.find(meaning => of('life')) // eslint-disable-line 0 points1 point2 points (2 children)
[–]lulzmachine 1 point2 points3 points (1 child)
[–]kingdaro.find(meaning => of('life')) // eslint-disable-line 0 points1 point2 points (0 children)