From 0fa3fd28ed05af1645f4ab01e2993f6b367cc0dc Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Wed, 5 Jul 2023 14:46:00 -0700 Subject: [PATCH] chore: use pop() instead of [0] --- config/filters.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/filters.js b/config/filters.js index ddca9c3b..8424d5d9 100644 --- a/config/filters.js +++ b/config/filters.js @@ -21,7 +21,7 @@ module.exports = { if (analytics.find((p) => p.page === post.url)) return true }) .sort((a, b) => { - const visitors = (page) => analytics.filter((p) => p.page === page.url)[0].visitors + const visitors = (page) => analytics.filter((p) => p.page === page.url).pop().visitors return visitors(b) - visitors(a) }) },