version 0.3.2, with 'identity', and Rhino support

This commit is contained in:
Jeremy Ashkenas
2009-10-29 14:45:56 -04:00
parent 4d09a85bae
commit d2d1285e26
3 changed files with 43 additions and 20 deletions

View File

@@ -81,7 +81,7 @@
</p>
<p>
Underscore provides 44-odd functions that support both the usual
Underscore provides 45-odd functions that support both the usual
functional suspects: <b>map</b>, <b>select</b>, <b>invoke</b> &mdash;
as well as more specialized helpers: function binding, javascript
templating, deep equality testing, and so on. It delegates to built-in
@@ -107,11 +107,11 @@
<p>
<table>
<tr>
<td><a href="underscore.js">Development Version (0.3.1)</a></td>
<td><a href="underscore.js">Development Version (0.3.2)</a></td>
<td><i>16kb, Uncompressed with Comments</i></td>
</tr>
<tr>
<td><a href="underscore-min.js">Production Version (0.3.1)</a></td>
<td><a href="underscore-min.js">Production Version (0.3.2)</a></td>
<td><i>4kb, Packed and Gzipped</i></td>
</tr>
</table>
@@ -158,7 +158,8 @@
<b>Utility</b>
<br />
<span class="methods"><a href="#noConflict">noConflict</a>,
<a href="#uniqueId">uniqueId</a>, <a href="#template">template</a></span>
<a href="#identity">identity</a>, <a href="#uniqueId">uniqueId</a>,
<a href="#template">template</a></span>
</p>
<div id="documentation">
@@ -700,6 +701,19 @@ _.isUndefined(window.missingVariable);
<pre>
var underscore = _.noConflict();</pre>
<p id="identity">
<b class="header">identity</b><code>_.identity(value)</code>
<br />
Returns the same value that is used as the argument. In math:
<tt>f(x) = x</tt><br />
This function looks useless, but is used throughout Underscore as
a default iterator.
</p>
<pre>
var moe = {name : 'moe'};
moe === _.identity(moe);
=> true</pre>
<p id="uniqueId">
<b class="header">uniqueId</b><code>_.uniqueId([prefix])</code>
<br />
@@ -736,6 +750,13 @@ _.template(list, {people : ['moe', 'curly', 'larry']});
<h2>Change Log</h2>
<p>
<b class="header">0.3.2</b><br />
Now runs on stock <a href="http://www.mozilla.org/rhino/">Rhino</a>
interpreters with: <tt>load("underscore.js")</tt>.
Added <a href="#identity"><tt>identity</tt></a> as a utility function.
</p>
<p>
<b class="header">0.3.1</b><br />
All iterators are now passed in the original collection as their third