|
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:
392 bytes
|
| Line | |
|---|
| 1 | import isArrayLike from './_isArrayLike.js';
|
|---|
| 2 | import findIndex from './findIndex.js';
|
|---|
| 3 | import findKey from './findKey.js';
|
|---|
| 4 |
|
|---|
| 5 | // Return the first value which passes a truth test.
|
|---|
| 6 | export default function find(obj, predicate, context) {
|
|---|
| 7 | var keyFinder = isArrayLike(obj) ? findIndex : findKey;
|
|---|
| 8 | var key = keyFinder(obj, predicate, context);
|
|---|
| 9 | if (key !== void 0 && key !== -1) return obj[key];
|
|---|
| 10 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.