diff --git a/index.html b/index.html
index 99380fece..f032259a6 100644
--- a/index.html
+++ b/index.html
@@ -171,7 +171,9 @@
Iterates over a list of elements, yielding each in turn to an iterator
function. The iterator is bound to the context object, if one is
- passed. If list is a JavaScript object, a pair with key
+ passed. Each invocation of iterator is called with three arguments,
+ element, index, and the list.
+ If list is a JavaScript object, a pair with key
and value properties will be yielded. If the list has an each
method of its own, it will be used instead. Delegates to the native
forEach function if it exists.
diff --git a/test/collections.js b/test/collections.js
index 7f28a7705..69fe9ec47 100644
--- a/test/collections.js
+++ b/test/collections.js
@@ -29,6 +29,10 @@ $(document).ready(function() {
_.each(obj, function(pair){ answers.push(pair.key); });
equals(answers.join(", "), 'one, two, three', 'iterating over objects works, and ignores the object prototype.');
delete obj.constructor.prototype.four;
+
+ answer = null;
+ _.each([1, 2, 3], function(num, index, arr){ if (_.include(arr, num)) answer = true; });
+ ok(answer, 'can reference the original collection from inside the iterator');
});
test('collections: map', function() {
diff --git a/underscore.js b/underscore.js
index 9c050fc80..90cafc284 100644
--- a/underscore.js
+++ b/underscore.js
@@ -38,16 +38,16 @@
if (obj.forEach) {
obj.forEach(iterator, context);
} else if (obj.length) {
- for (var i=0, l = obj.length; i