<script>
function fn(max,min){//数值区间
return Math.round(Math.random()*(max-min)+min)
}
var number=' '//空字符串来接取循环
for(var i = 0;i<4;i++){
number+=fn(0,9)//调用四次函数
}
console.log(number);
</script>
标签:function,min,max,验证码,四位,var,接取,Math,随机
来源: https://www.cnblogs.com/ykwqbsw/p/16541642.html