Created
January 10, 2018 09:11
-
-
Save Mark24Code/e38383234ed8b5701a746ecb3ee23313 to your computer and use it in GitHub Desktop.
乱序数组算法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function unorderArr(arr){ | |
let carr = arr.concat(); | |
carr.sort(function(x,y){ | |
return 0.5-Math.random() | |
}) | |
return carr | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment