| 1435 | |
| 1436 | // Determine whether all of the elements pass a truth test. |
| 1437 | function every(obj, predicate, context) { |
| 1438 | predicate = cb(predicate, context); |
| 1439 | var _keys = !isArrayLike(obj) && keys(obj), |
| 1440 | length = (_keys || obj).length; |
| 1441 | for (var index = 0; index < length; index++) { |
| 1442 | var currentKey = _keys ? _keys[index] : index; |
| 1443 | if (!predicate(obj[currentKey], currentKey, obj)) return false; |
| 1444 | } |
| 1445 | return true; |
| 1446 | } |
| 1447 | |
| 1448 | // Determine if at least one element in the object passes a truth test. |
| 1449 | function some(obj, predicate, context) { |