The name "reduce" gives a good clue to what it *does* (reduce an array to one value based on the whole thing). However, to understand how it *works* is easier if you use Ruby's alternate name for it: inject. It sort of "injects" the function between each consecutive pair of elements in the array. At least, that's effectively what happens if you use something like simple addition. So:
[1,2,3,4].reduce(function(prev,curr) { return prev + curr })
is equivalent to 1 + 2 + 3 + 4. Unfortunately, this style doesn't make it quite so clear, but if you do something like:
add = function(prev,curr) { return prev + curr };
[1,2,3,4].reduce(add);
that makes it a bit clearer in the reduce call, just what you're doing. (Especially if you declare add further away.)
-Dave