I found such functions in nete:
function shuffle( array ) { // Shuffle an array for(var j, x, i = array.length; i; j = parseInt(Math.random() * i), x = array[--i], array[i] = array[j], array[j] = x); return true; } function shuffle(a) { for (let i = a.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)); [a[i], a[j]] = [a[j], a[i]]; } return a; } Could you explain how the loop without a body works? (from the first function) and what the string [a[i], a[j]] = [a[j], a[i]]; means [a[i], a[j]] = [a[j], a[i]]; ? or give a link
forloop is and what parameters it takes - Alexey Shimansky[a[i], a[j]] = [a[j], a[i]]swapped the elements of the array with indicesiandj. - Visman