JS Code for Generating OTP -
* Learn how to create a simple JavaScript function to generate a random 4-digit OTP.
function OTP() {
let otp = "";
otp = Math.floor(Math.random() * 9000 + 1000);
return otp;
}
console.log("Your OTP is-", OTP());
Comments
Post a Comment
Please do not enter any spam link in the comment box.