Merge pull request #481 from dbrans/master

Fix for #478 - any and every should be consistent about casting result to boolean
This commit is contained in:
Jeremy Ashkenas
2012-02-16 13:33:36 -08:00

View File

@@ -180,7 +180,7 @@
each(obj, function(value, index, list) { each(obj, function(value, index, list) {
if (!(result = result && iterator.call(context, value, index, list))) return breaker; if (!(result = result && iterator.call(context, value, index, list))) return breaker;
}); });
return result; return !!result;
}; };
// Determine if at least one element in the object matches a truth test. // Determine if at least one element in the object matches a truth test.