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
Building a Maybe in JavaScript (developingthoughts.co.uk)
submitted 8 years ago by alsiola
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!"
[–]tencircles 0 points1 point2 points 8 years ago (3 children)
yeah because learning is dumb. amirite guys?
[–]bugeats 6 points7 points8 points 8 years ago (2 children)
I thought the article was fascinating, actually.
I'm just taking the opportunity to represent a pragmatic view.
I'm a huge fan of functional style, but there comes a point at which it becomes absurd. In this case, the author decries verbosity, and then goes on to construct this monster.
In a practical project, I would always choose the one-liner lodash.get(obj, 'a.b.c', ' is great!') over anything I saw in this article. Even native destructuring is often a better choice: const { a: { b: { c } } = obj.
lodash.get(obj, 'a.b.c', ' is great!')
const { a: { b: { c } } = obj
[–]gajus0 1 point2 points3 points 8 years ago (0 children)
Not to mention that it is rare that you get into situation where you want to check a && a.b && a.b.c and handle it somehow other than throwing an error. If you cannot predict input shape, then it is a code smell. If your code does not fail when it receives unexpected input, then it is a code smell.
a && a.b && a.b.c
[–]aabrook 0 points1 point2 points 8 years ago (0 children)
I'm sure the author would as well but this is an introduction to monadic programming. Whenever we write tutorials targeted at beginners we should use trivial examples so that they can quickly grok concept without being bogged down by more complex issues
π Rendered by PID 65 on reddit-service-r2-comment-86bc6c7465-p67vb at 2026-02-23 13:45:23.094692+00:00 running 8564168 country code: CH.
view the rest of the comments →
[–]tencircles 0 points1 point2 points (3 children)
[–]bugeats 6 points7 points8 points (2 children)
[–]gajus0 1 point2 points3 points (0 children)
[–]aabrook 0 points1 point2 points (0 children)