Skip to content

Commit

Permalink
Add sum() to README
Browse files Browse the repository at this point in the history
  • Loading branch information
xaviershay committed Dec 28, 2008
1 parent 8e665a5 commit c7d4bca
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.textile
Expand Up @@ -15,7 +15,10 @@ h2. Usage

sum = $([1,2,3]).inject(0, function (accumulator) {
return accumulator + this;
} // => 6</code></pre>
} // => 6

// Sum is actually provided as a convenience function
$([1,2,3]).sum() // => 6</code></pre>

Every function is passed an option index parameter
<pre><code>indexed_squares = $([1,2,3]).collect(function (index) {
Expand Down

0 comments on commit c7d4bca

Please sign in to comment.