SHARE
TWEET

Untitled

a guest Jan 26th, 2019 128 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function password (args){
  2.     let username = args[0];
  3.     let counter = 0;
  4.     let tries = args.lenght;
  5.  
  6.     for (let pass = 1; pass< tries; i++){
  7.         let password = String(args[i]).split("").reverse().join("");
  8.         if (password === username){
  9.             console.log(`User ${username} logged in." `);
  10.            break;
  11.        }else{
  12.            console.log(`Incorrect password. Try again.`)
  13.            counter+=1
  14.        }if (counter ===4){
  15.            console.log(`User ${username} blocked!`)
  16.            break;
  17.        }
  18.    }
  19.  
  20.  
  21. }
  22. password(['Acer','login','go','let me in','recA'])
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top