adding an isArguments checker and enabling iteration (using each) over JS object hashes that have numeric length properties

This commit is contained in:
Jeremy Ashkenas
2009-12-09 13:41:19 -05:00
parent 225d795836
commit 5c314d206e
4 changed files with 48 additions and 15 deletions

View File

@@ -813,6 +813,18 @@ _.isElement(jQuery('body')[0]);
=> false
_.isArray([1,2,3]);
=> true
</pre>
<p id="isArguments">
<b class="header">isArguments</b><code>_.isArguments(object)</code>
<br />
Returns <i>true</i> if <b>object</b> is an Arguments object.
</p>
<pre>
(function(){ return _.isArguments(arguments); })(1, 2, 3);
=&gt; true
_.isArguments([1,2,3]);
=&gt; false
</pre>
<p id="isFunction">