Shuffling multidimensional array in js
问题 This function shuffles only matrix[y], but I want it to shuffle matrix[y][x] But it doesn't want to shuffle correctly. The code what I used: function Shuffle(arguments) { for (var k = 0; k < arguments.length; k++) { var i = arguments[k].length; if (i == 0) return false; else { while (--i) { var j = Math.floor(Math.random() * (i + 1)); var tempi = arguments[k][i]; var tempj = arguments[k][j]; arguments[k][i] = tempj; arguments[k][j] = tempi; } return arguments; } } return arguments } var