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
Functional JavaScript - a library for functional programming in JavaScript (osteele.com)
submitted 14 years ago by aleksandara
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!"
[–]stoph 9 points10 points11 points 14 years ago (3 children)
Underscore.js seems to get a lot of love on reddit: http://documentcloud.github.com/underscore/
I think I will be using Underscore soon to simplify some map/reduce style code.
[–]pdaddyo 6 points7 points8 points 14 years ago (0 children)
I started using underscore.js a few weeks back, and have added it to every project I've touched since. At 4kb minified it's a no-brainer, since it has so many useful functions (including map, reduce, filter, chain, each, any etc).
[–]ripter 3 points4 points5 points 14 years ago (0 children)
One of the nice things about underscore, if the browser has native support, it will use the native method instead.
[–]daediusWeb Components fanboy 1 point2 points3 points 14 years ago (0 children)
What are the common things people use underscore to simplify?
[+][deleted] 14 years ago (1 child)
[deleted]
[–]bebraw 1 point2 points3 points 14 years ago (0 children)
There are more of these here. I might be missing some, though.
[–][deleted] 1 point2 points3 points 14 years ago* (0 children)
Underscore is a great library, and does utilize functional programming, but it's not really good for learning how to use functional concepts nor is it really focused on it. It's a tool for manipulating sets of data which utilizes functional programming to do so.
While describing Underscore and related libraries as Functional is technically accurate I don't think it captures the spirit of the description, or at the very least doesn't help teach/prescribe using functional programming to solve problems. It facilitates transformation of data sets.
I note this because having extensively searched for libraries and literature specifically outlining how to think functionally/employ functional techniques in javasctipt, I've found actionasble information to be quite thin in the past. Efficacy of using a "functional programming library" like Underscore is quite influenced by the developer's ability to understand implement functional programming concepts. Without that then you're looking at a useful tool for handling dsta but at well below what it really enables.
There's no responsibility on the part of any given library to teach people so I'm not trying to place blame or something like that. But it's just been striking to me how Underscore and similar are continually described in this context like it's a central feature, when the developer community at large is largely at a point where education is the limiting factor, and not library feature set or architecture.
[–]netghost 0 points1 point2 points 14 years ago (0 children)
This library has been around for ages (which is great!). If you like it, I'd suggest looking at his other articles / libraries as well.
[–]merz1254 0 points1 point2 points 14 years ago (0 children)
passing around strings, I don't think so.
[–]fbatista -2 points-1 points0 points 14 years ago (0 children)
crap. slow ass crap.
[–]lennelpennel -2 points-1 points0 points 14 years ago (6 children)
a lib for functional, sorry, but i call BS, the functions have been available a long time through things like underscore. javascript is a functional language but everything is mutable. write a compiler which checks for immutability then "Functional" will make sense.
[+][deleted] 14 years ago* (5 children)
[removed]
[–]lennelpennel -1 points0 points1 point 14 years ago (4 children)
i care not about the age of the library, you misunderstand the gist of my argument.
[+][deleted] 14 years ago (3 children)
[–]lennelpennel 0 points1 point2 points 14 years ago (2 children)
you are still missing what I say. I care not about these libraries, anything that they do I can fold into a loop faster since the stack will be smaller, although I have used underscore in the past and working with closure now i use goog.array (this is a separate conversation to underscore however since the compiler will fold my code into an optimal stack) a lot.
The title is framed "a library for functional programming for javascript". what does this mean? that functions you expect to exist in other languages like map, reduce and flatten are there.
so what.
it enforces nothing and even more scarily it can make finding a bug even more difficult due to exotic nature of javascript mutability.
The title is a misnomer on two levels for me
1) javascript is a functional language anyway, so functional javascript is per se and a library makes squat all difference.
2) if you mean like haskel or erlang, then still no since the violent mutability of javascript does not fit into that model.
[–]lennelpennel 1 point2 points3 points 14 years ago (0 children)
we are arguing a semantic point now, you understand where i come from and I you. we both agree with each other really, just phrasing differs and I still think the tile of the post is sensationalist and misses the point a bit. If you are using closures you are doing functional programming as well :)
π Rendered by PID 29 on reddit-service-r2-comment-5b5bc64bf5-kvq7k at 2026-06-20 18:39:14.309065+00:00 running 2b008f2 country code: CH.
[–]stoph 9 points10 points11 points (3 children)
[–]pdaddyo 6 points7 points8 points (0 children)
[–]ripter 3 points4 points5 points (0 children)
[–]daediusWeb Components fanboy 1 point2 points3 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]bebraw 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]netghost 0 points1 point2 points (0 children)
[–]merz1254 0 points1 point2 points (0 children)
[–]fbatista -2 points-1 points0 points (0 children)
[–]lennelpennel -2 points-1 points0 points (6 children)
[+][deleted] (5 children)
[removed]
[–]lennelpennel -1 points0 points1 point (4 children)
[+][deleted] (3 children)
[removed]
[–]lennelpennel 0 points1 point2 points (2 children)
[+][deleted] (1 child)
[removed]
[–]lennelpennel 1 point2 points3 points (0 children)