/**
* 随机生成指定字符串的方法
* 1.n 指定字符串的长度
*/
function randomStr(n) {
console.log('11')
const str = 'abcdefghijklmnopqrstuvwxyz0123456789'
let res = ''
for (let i = 0; i < n; i++) {
res += str.charAt(Math.round(Math.random() * str.length))
}
return res
}
let random1 = randomStr(3)
console.log('哈哈哈', random1)