标签:function amp rom fun i++ parse else console turn
function testcode(n){
var arr= []
for( var i = 0;i < n; i++){
var num =parseInt(Math.random()*123)
if( num >0 && num < 9){
arr.unshift(n)
}else if(num >= 65 && num <= 90 || num >= 97 && num <= 122){
arr.unshift(String.fromCharCode(num))
}else{
i--
}
}
return arr.join("")
}
console.log(testcode(4))
标签:function amp rom fun i++ parse else console turn
原文地址:https://www.cnblogs.com/cupid10/p/13143922.html