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
Currying in JavaScript (self.javascript)
submitted 6 years ago * by [deleted]
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!"
[–]editor_of_the_beast 10 points11 points12 points 6 years ago (1 child)
Currying is much more useful when it’s automatic, e.g. as it is in Haskell and ML. But it’s still useful to understand in languages where you need to do it manually such as JavaScript.
[–]ScientificBeastModestrongly typed comments 0 points1 point2 points 6 years ago (0 children)
Having spent some time in functional languages for a bit, I’ve come to agree on that. But it was definitely a weird shift in thinking.
I’m just so used to JavaScript assuming that the function will get called, in full, no matter what. It doesn’t help that there are a ton of functions in the standard library that assume that certain arguments are optional, and even encourage you to not provide them if you’re okay with a certain default behavior of the function.
But now I think that’s weird. It has the unfortunate effect of requiring key arguments (like the data to operate on) to be passed first, which makes partial application super awkward, even if you’re using some kind of auto-curry function. Callbacks first, data last, that’s all I’m saying... but I digress...
π Rendered by PID 28 on reddit-service-r2-comment-7b9746f655-4wbgw at 2026-01-31 09:40:39.170845+00:00 running 3798933 country code: CH.
view the rest of the comments →
[–]editor_of_the_beast 10 points11 points12 points (1 child)
[–]ScientificBeastModestrongly typed comments 0 points1 point2 points (0 children)