From a023f9204925dbcc0c8fdc590a3d4e29da6eb906 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 16 Apr 2017 16:06:30 -0500 Subject: [PATCH] Fix typo in `find`. --- find.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/find.js b/find.js index 717417226..b96b8c2a1 100644 --- a/find.js +++ b/find.js @@ -26,10 +26,12 @@ import keys from './keys' * // => object for 'barney' */ function find(collection, predicate, fromIndex) { + let iteratee const iterable = Object(collection) + if (!isArrayLike(collection)) { collection = keys(collection) - predicate = (key) => iteratee(iterable[key], key, iterable) + iteratee = (key) => predicate(iterable[key], key, iterable) } const index = findIndex(collection, predicate, fromIndex) return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined