Answer the question
In order to leave comments, you need to log in
How to make a script to launch random mp3 files?
There are a lot of mp3 files.
It is necessary that the js file calculates the order of playing files randomly.
Answer the question
In order to leave comments, you need to log in
function shuffleArray(array) {
for (let i = array.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[array[i], array[j]] = [array[j], array[i]];
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question