n位字母数字混合验证码
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))