chore: randomize featured posts on build

This commit is contained in:
Cory Dransfeldt 2024-05-08 09:27:21 -07:00
parent 6f30c62761
commit 4b0ff04023
No known key found for this signature in database
2 changed files with 11 additions and 1 deletions

View file

@ -0,0 +1,9 @@
export const shuffleArray = array => {
for (let i = array.length - 1; i > 0; i--) {
let j = Math.floor(Math.random() * (i + 1));
let temp = array[i];
array[i] = array[j];
array[j] = temp;
}
return array
}