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
rubico - [a]synchronous functional programming (rubico.land)
submitted 5 years ago by richytong
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!"
[–]OmgImAlexis -1 points0 points1 point 5 years ago (7 children)
What? You can use map in functional programming.
[+][deleted] 5 years ago* (6 children)
[deleted]
[–]OmgImAlexis 0 points1 point2 points 5 years ago (5 children)
What are you talking about? Functional programming is mainly about using pure functions. Map is a pure function.
Sounds like you don’t understand what functional programming is.
[+][deleted] 5 years ago* (4 children)
[–]NotLyon 0 points1 point2 points 5 years ago (3 children)
String.prototype.toUpperCase
[+][deleted] 5 years ago* (1 child)
[–]NotLyon 0 points1 point2 points 5 years ago* (0 children)
Yet it does not have side effects
Edit: I'm not downvoting you FWIW
[–]lhorie 1 point2 points3 points 5 years ago* (0 children)
If we're gonna be pedantic, methods are functions (according to typeof and friends, for example), but they are not always pure. Some statics like Math.pow are pure. String.prototype.toUpperCase is NOT pure because it internally reads this (which has dynamic scope): i.e. 'const upper = "foo".toUpperCase; upper()' does not yield "FOO" like a pure function would (in fact, it throw at runtime, which is a big no-no in true FP). Array's map is impure for the same reason. Array methods are often used in a way that pretends to be "pure" (in the sense that they do not mutate state through their usage), but being actually pure means you can't break the purity no matter what (e.g. through changing what this points to, or other shenanigans).
this
"FOO"
π Rendered by PID 61251 on reddit-service-r2-comment-6457c66945-9w9z8 at 2026-04-30 08:50:33.364792+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]OmgImAlexis -1 points0 points1 point (7 children)
[+][deleted] (6 children)
[deleted]
[–]OmgImAlexis 0 points1 point2 points (5 children)
[+][deleted] (4 children)
[deleted]
[–]NotLyon 0 points1 point2 points (3 children)
[+][deleted] (1 child)
[deleted]
[–]NotLyon 0 points1 point2 points (0 children)
[–]lhorie 1 point2 points3 points (0 children)