抽取数组各个值中随机的三个不同的人的名字
var arr = ["王","赵","孙","李","张","周","吴"]; for (var i = 3; i > 0 ; i--) { var a = Math.round(Math.random()*arr.length-1); var b = arr.splice(a,1); console.log(b); }
var arr = ["王","赵","孙","李","张","周","吴"]; for (var i = 3; i > 0 ; i--) { var a = Math.round(Math.random()*arr.length-1); var b = arr.splice(a,1); console.log(b); }