Is there a way to rearrange the items in an array according to their position? Here's the code I have:
setColor(colors[Math.floor(Math.random() * colors.length)]);
Instead of choosing randomly, I would prefer to sort the items based on their array position. Thank you!