|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
541 bytes
|
| Line | |
|---|
| 1 | import cb from './_cb.js';
|
|---|
| 2 | import isArrayLike from './_isArrayLike.js';
|
|---|
| 3 | import keys from './keys.js';
|
|---|
| 4 |
|
|---|
| 5 | // Determine if at least one element in the object passes a truth test.
|
|---|
| 6 | export default function some(obj, predicate, context) {
|
|---|
| 7 | predicate = cb(predicate, context);
|
|---|
| 8 | var _keys = !isArrayLike(obj) && keys(obj),
|
|---|
| 9 | length = (_keys || obj).length;
|
|---|
| 10 | for (var index = 0; index < length; index++) {
|
|---|
| 11 | var currentKey = _keys ? _keys[index] : index;
|
|---|
| 12 | if (predicate(obj[currentKey], currentKey, obj)) return true;
|
|---|
| 13 | }
|
|---|
| 14 | return false;
|
|---|
| 15 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.