started passing in the collection as the third argument to _.each iterators (Issue #1)

This commit is contained in:
Jeremy Ashkenas
2009-10-29 10:26:16 -04:00
parent e381f7b626
commit 8e7b8d2dea
3 changed files with 10 additions and 4 deletions

View File

@@ -171,7 +171,9 @@
<br />
Iterates over a <b>list</b> of elements, yielding each in turn to an <b>iterator</b>
function. The <b>iterator</b> is bound to the <b>context</b> object, if one is
passed. If <b>list</b> is a JavaScript object, a pair with <b>key</b>
passed. Each invocation of <b>iterator</b> is called with three arguments,
<i>element</i>, <i>index</i>, and the <b>list</b>.
If <b>list</b> is a JavaScript object, a pair with <b>key</b>
and <b>value</b> properties will be yielded. If the list has an <b>each</b>
method of its own, it will be used instead. Delegates to the native
<b>forEach</b> function if it exists.