📅  最后修改于: 2022-03-11 15:01:50.191000             🧑  作者: Mango
function generateOTP() {
// Declare a digits variable
// which stores all digits
var digits = '0123456789';
let OTP = '';
for (let i = 0; i < 4; i++ ) {
OTP += digits[Math.floor(Math.random() * 10)];
}
return OTP;
}