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