Math随机数方法
//1.产生随机小数 范围0<=x<1
console.log(Math.random());
//2.得到两个数之间的随机整数,包括两个数在内
//Math.floor(Math.random()*(max-min+1))+min;
function getRandom(min,max){
return Math.floor(Math.random()*(max-min+1))+min;
}
console.log(getRandom(1,10));
//3.随机点名
var arr