<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: JavaScript reduce</title>
	<atom:link href="http://christopherowen.id.au/blog/2008/07/08/javascript-reduce/feed/" rel="self" type="application/rss+xml" />
	<link>http://christopherowen.id.au/blog/2008/07/08/javascript-reduce/</link>
	<description>Stuff cubed plus one</description>
	<lastBuildDate>Fri, 07 Jan 2011 21:47:07 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Bookmarks about Javascript</title>
		<link>http://christopherowen.id.au/blog/2008/07/08/javascript-reduce/comment-page-1/#comment-7107</link>
		<dc:creator>Bookmarks about Javascript</dc:creator>
		<pubDate>Wed, 13 Aug 2008 19:45:17 +0000</pubDate>
		<guid isPermaLink="false">http://christopherowen.id.au/blog/?p=42#comment-7107</guid>
		<description>[...] - bookmarked by 4 members originally found by marthitacisneros on 2008-07-20  JavaScript reduce  http://christopherowen.id.au/blog/2008/07/08/javascript-reduce/ - bookmarked by 3 members [...]</description>
		<content:encoded><![CDATA[<p>[...] &#8211; bookmarked by 4 members originally found by marthitacisneros on 2008-07-20  JavaScript reduce  <a href="http://christopherowen.id.au/blog/2008/07/08/javascript-reduce/" rel="nofollow">http://christopherowen.id.au/blog/2008/07/08/javascript-reduce/</a> &#8211; bookmarked by 3 members [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Ryall</title>
		<link>http://christopherowen.id.au/blog/2008/07/08/javascript-reduce/comment-page-1/#comment-7083</link>
		<dc:creator>Matt Ryall</dc:creator>
		<pubDate>Tue, 08 Jul 2008 23:12:45 +0000</pubDate>
		<guid isPermaLink="false">http://christopherowen.id.au/blog/?p=42#comment-7083</guid>
		<description>Wow, that is cool. Using all four arguments of the reduce function is impressive. :)

Rather than using reduce, you could make group() recursive and pass the output array to it. This might make the array manipulation a bit easier because you don&#039;t have to return it:

&lt;pre lang=&quot;javascript&quot;&gt;previousValue[-1] = previousValue[-1].concat(currentValue);&lt;/pre&gt;

Not very functional, perhaps. :)

It took me a while to understand why you&#039;re putting double brackets around this:

&lt;pre lang=&quot;javascript&quot;&gt;return previousValue.concat([[currentValue]]);&lt;/pre&gt;

The overloaded argument handling of Array.concat is quite annoying in this case.</description>
		<content:encoded><![CDATA[<p>Wow, that is cool. Using all four arguments of the reduce function is impressive. <img src='http://christopherowen.id.au/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Rather than using reduce, you could make group() recursive and pass the output array to it. This might make the array manipulation a bit easier because you don&#8217;t have to return it:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">previousValue<span style="color: #009900;">&#91;</span><span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> previousValue<span style="color: #009900;">&#91;</span><span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">concat</span><span style="color: #009900;">&#40;</span>currentValue<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Not very functional, perhaps. <img src='http://christopherowen.id.au/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>It took me a while to understand why you&#8217;re putting double brackets around this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">return</span> previousValue.<span style="color: #660066;">concat</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#91;</span>currentValue<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The overloaded argument handling of Array.concat is quite annoying in this case.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

