var strCode='zxcvbnmasdfghjklopiuytrewqAWEDRFTGYHUJIK';
var str='';
for(var i=0;i<4;i++){
    var rand=Math.round(Math.random()*61);
    if(str.indexOf(strCode.charAt(rand))==-1){
        str+=strCode.charAt(rand);
    }else{
        i--;
    }
}
console.log(str);

 原文链接:http://www.qdfuns.com/notes/42231/cfc6d7c792d485de06587c532587a08d.html

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-09
  • 2022-02-26
  • 2022-12-23
猜你喜欢
  • 2021-11-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案