Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

generate otp using javascript

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;
}
Source by www.facebook.com #
 
PREVIOUS NEXT
Tagged: #generate #otp #javascript
ADD COMMENT
Topic
Name
5+1 =