jeudi 10 août 2023

How to return objects from array in random order on every render?

I have an array with N numbers of element. For example this one:

let i = 0;
while(i <= 40){
    console.log(i++)
}

This will always return list of numbers from 0 to 40,what I want to achieve is to order numbers in random order every time I run the function.




Aucun commentaire:

Enregistrer un commentaire