<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Rails Forum - Ruby on Rails Help and Discussion Forum - foldl javascript prototype question]]></title>
		<link>http://railsforum.com/viewtopic.php?id=39497</link>
		<description><![CDATA[The most recent posts in foldl javascript prototype question.]]></description>
		<lastBuildDate>Sun, 13 Jun 2010 20:54:28 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[foldl javascript prototype question]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=126292#p126292</link>
			<description><![CDATA[<p>Hey all,</p><p>I found someone using an example of a script here. I don&#039;t understand it. Where is &quot;acc&quot; being defined?</p><p>Array.prototype.foldl = function(fnc,start) {<br />&nbsp; &nbsp; var a = start;<br />&nbsp; &nbsp; for (var i = 0; i &lt; this.length; i++) {<br />&nbsp; &nbsp; &nbsp; &nbsp; a = fnc(this<em>,a);<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; return a;<br />}</em></p><p><em>Some trivial examples could be:</em></p><p><em>var l = [&quot;hello&quot; , &quot;world&quot;];<br />l.foldl(function(i, acc) { return acc+&quot; &quot;+i; }, &quot;&quot;) // =&gt; returns &quot;hello world&quot;<br /> </em></p>]]></description>
			<author><![CDATA[dummy@example.com (johnmerlino)]]></author>
			<pubDate>Sun, 13 Jun 2010 20:54:28 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=126292#p126292</guid>
		</item>
	</channel>
</rss>
