📌  相关文章
📜  javascript 函数生成随机字符串 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:51.701000             🧑  作者: Mango

代码示例1
//Create a function that returns a string, of a given length
const genRand = (len) => {
  return Math.random().toString(36).substring(2,len+2);
}

console.log(genRand(8));
//Expected output example: 4yg020wn