From 06c616b75cb22b8adf6f923d61225608f48247af Mon Sep 17 00:00:00 2001 From: Siarhei Date: Fri, 11 May 2018 16:05:36 +0400 Subject: [PATCH] Simplify findLast snippet --- test/findLast/findLast.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/findLast/findLast.js b/test/findLast/findLast.js index 82f3a11e6..38f769e78 100644 --- a/test/findLast/findLast.js +++ b/test/findLast/findLast.js @@ -1,2 +1,2 @@ -const findLast = (arr, fn) => arr.filter(fn).slice(-1)[0]; +const findLast = (arr, fn) => arr.filter(fn).pop(); module.exports = findLast; \ No newline at end of file