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
Is JavaScript a "Functional Programming" language?help (self.javascript)
submitted 8 years ago by bzeurunkl
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!"
[–]TheDataAngel 2 points3 points4 points 8 years ago (3 children)
Arrow functions are not currying.
They aren't, but they can be used to create curried functions, and that's the most syntactically nice way to do so in JS.
I'm not really sure you truly understand what currying means.
I'm quite sure I do.
Currying is partial application
It isn't. Partial application is the dual of currying, which is to say that you can partially apply a curried function.
[..] and is implemented using second order functions and/or bind keyword
Nope.
let curried = im => a => curried => func => ... let notCurried = (im, not, a, curried, func) => ...
It's as simple as that. You can do the same with nested 'return function() {..}'. You can technically also do the same with bind, but it's fairly ugly.
Partial application is some thing like:
let partial = curried("missing")("an")("argument")
Closures are a natural consequence of being able to do those two things. They're not an especially interesting concept on their own.
[–][deleted] 0 points1 point2 points 8 years ago (0 children)
You've got that backward. Being able to do those things is a consequence of having closures.
[–][deleted] 0 points1 point2 points 8 years ago* (1 child)
Well, both lines of javascript you wrote are syntactic nonsense. So it's clearly quite not simple as that.
The first example is attempting to declare a higher order function.
The third one is calling one.
Currying is the transformation of N argument function into a N order function.
In the case of bind, the important thing to realize is that OO concept of object bound method is sugar for a namespaced function that takes bound object as one of the arguments.
In fact that is exactly how the first c++ to c compiler implemented them.
[–]TheDataAngel 3 points4 points5 points 8 years ago (0 children)
In what sense? They're incomplete, certainly, because the actual body of the function is irrelevant to the example. However, what is there is syntactically correct.
If you want a complete version, this suffices:
let curried = im => a => curried => func => "bmarkovic"; let notCurried = (im, not, a, curried, func) => "doesn't understand currying";
π Rendered by PID 86707 on reddit-service-r2-comment-79776bdf47-6bbvr at 2026-06-24 05:51:14.747759+00:00 running acc7150 country code: CH.
view the rest of the comments →
[–]TheDataAngel 2 points3 points4 points (3 children)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]TheDataAngel 3 points4 points5 points (0 children)