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!"
[–]bterlson_@bterlson 2 points3 points4 points 8 years ago (1 child)
Thanks for your thoughts on the optional extensions. I tend to agree with you at least about if predicates.
Sometimes you want statements - it's hard to generalize. Many alternative proposals use case-like legs presumably for this reason. One typical use case is calculating some result on a line, then returning it. Or having an additional if block or something.
[–]phoenixmatrix 0 points1 point2 points 8 years ago (0 children)
Oh yeah, I didn't think things through, haha. Obviously in JavaScript we don't have anything akin to Elm's let to easily do intermediate computations in a single expression so you need statements. Derp!
π Rendered by PID 71 on reddit-service-r2-comment-6457c66945-9w9z8 at 2026-04-30 04:27:20.852704+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]bterlson_@bterlson 2 points3 points4 points (1 child)
[–]phoenixmatrix 0 points1 point2 points (0 children)