Home  >  Article  >  Web Front-end  >  How to quickly disrupt and rearrange javascript arrays_javascript skills

How to quickly disrupt and rearrange javascript arrays_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:05:541261browse

Copy code The code is as follows:

var arr = [1,2,3,4, 5,6,7,8,9,10];
var out = arr.sort(function(){
return Math.random() > 0.5;
}
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn