functionshuffleArray(array){letcurrentIndex=array.lengthletrandomIndexwhile(currentIndex!=0){randomIndex=Math.floor(Math.random()*currentIndex);currentIndex--;[array[currentIndex],array[randomIndex]]=[array[randomIndex],array[currentIndex]];}}// Then
vararr=['a','b','c','d','e','f',', 'g'];shuffleArray(arr);console.log(arr);