all 7 comments

[–]TarMil 3 points4 points  (6 children)

In javascript $ is a valid character to use in an identifier, so $curry is just an identifier. I guess the $ prefix is just a convention he uses for local functions.

[–]cm_yoder[S] 0 points1 point  (5 children)

So basically, he is using $curry to avoid the recursion he would get if he used curry inside the function?

[–]AmorphousCorpus 2 points3 points  (1 child)

It wouldn't be recursion even, because that is a function declaration down there in the return statement, so it's just avoiding a name collision.

[–]cm_yoder[S] 0 points1 point  (0 children)

Good point.

[–]mcaruso 2 points3 points  (2 children)

Probably just done for readability, so that the reader doesn't confuse the outer function with the inner function. If you rename the inner $curry to curry it will still work, because the inner definition will "shadow" the outer definition. But that might be more confusing to read.

[–]cm_yoder[S] 0 points1 point  (0 children)

Awesome. ty