chore: use pop() instead of [0]
This commit is contained in:
parent
c1900315a3
commit
0fa3fd28ed
1 changed files with 1 additions and 1 deletions
|
@ -21,7 +21,7 @@ module.exports = {
|
||||||
if (analytics.find((p) => p.page === post.url)) return true
|
if (analytics.find((p) => p.page === post.url)) return true
|
||||||
})
|
})
|
||||||
.sort((a, b) => {
|
.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)
|
return visitors(b) - visitors(a)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
Reference in a new issue