标签:math 生成 bsp floor 随机数 ons return and 随机
createCode () {
const str = ‘abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789‘;
let text = ‘‘;
for (let i = 0; i < 20; i++) {
const number = Math.floor(Math.random() * str.length);
const t = str.charAt(number);
text += t;
}
return text;
}
标签:math 生成 bsp floor 随机数 ons return and 随机
原文地址:https://www.cnblogs.com/fczbk/p/12394715.html