mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 00:27:50 +00:00
first round of tests...
This commit is contained in:
@@ -35,6 +35,7 @@ window._ = {
|
||||
// Determine whether all of the elements match a truth test. Delegate to
|
||||
// Javascript 1.6's every(), if it is present.
|
||||
all : function(obj, iterator, context) {
|
||||
iterator = iterator || function(v){ return v; };
|
||||
if (obj.every) return obj.every(iterator, context);
|
||||
var result = true;
|
||||
_.each(obj, function(value, index) {
|
||||
@@ -47,6 +48,7 @@ window._ = {
|
||||
// Determine if at least one element in the object matches a truth test. Use
|
||||
// Javascript 1.6's some(), if it exists.
|
||||
any : function(obj, iterator, context) {
|
||||
iterator = iterator || function(v) { return v; };
|
||||
if (obj.some) return obj.some(iterator, context);
|
||||
var result = false;
|
||||
_.each(obj, function(value, index) {
|
||||
|
||||
Reference in New Issue
Block a user