From 53cac4eef41d92e0f7f4378b337e0b847ae15de9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Lipi=C5=84ski?= Date: Mon, 3 Apr 2017 11:53:13 +0200 Subject: [PATCH] ESify `find` implementation. --- find.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/find.js b/find.js index 2f3df8356..717417226 100644 --- a/find.js +++ b/find.js @@ -26,13 +26,13 @@ import keys from './keys' * // => object for 'barney' */ function find(collection, predicate, fromIndex) { - var iterable = Object(collection); + const iterable = Object(collection) if (!isArrayLike(collection)) { - collection = keys(collection); - predicate = function(key) { return iteratee(iterable[key], key, iterable); }; + collection = keys(collection) + predicate = (key) => iteratee(iterable[key], key, iterable) } - var index = findIndex(collection, predicate, fromIndex); - return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; + const index = findIndex(collection, predicate, fromIndex) + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined } export default find