TZinovieva

Password

Oct 11th, 2022
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function password(input) {
  2.     let username = input[0];
  3.     let password = input[1];
  4.  
  5.     let index = 2;
  6.     let currentPassword = input[index];
  7.     index++;
  8.  
  9.     while (currentPassword !== password) {
  10.         currentPassword = input[index];
  11.         index++;
  12.     }
  13.         console.log(`Welcome ${username}!`);
  14.     }
Advertisement
Add Comment
Please, Sign In to add comment