javascript数组快速打乱重排的方法

时间:2014-01-02    点击:73   

复制代码 代码如下:

var arr = [1,2,3,4,5,6,7,8,9,10];
var out = arr.sort(function(){
  return Math.random() > 0.5;
}

Javascript中常见的校验如域名、手机、邮箱等等
JavaScript四种调用模式和this示例介绍
ParseInt函数参数设置介绍
JS中Date日期函数中的参数使用介绍
JavaScript中Math对象方法使用概述
> 返回     
地址:上海市普陀区胶州路941号长久商务中心 电话: QQ:
© Copyright 2012 上海网络 Product All Rights Reserved