用 js 实现随机选取 10–100 之间的 10 个数字,存入一个数组,并排序。
var iArray = [];
function getRandom(istart, iend) {
var iChoice = iend - istart + 1;
var res = Math.floor(Math.random() * iChoice + istart);
return res;
}
var iArray = [];
function getRandom(istart, iend) {
var iChoice = iend - istart + 1;
var res = Math.floor(Math.random() * iChoice + istart);
return res;
}