ybakun

2021/07/07 Yuliia Bakun

Jul 7th, 2021
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Проверка логина
  2. // https://learn.javascript.ru/task/check-login
  3.  
  4. let login = prompt("Enter your login", "here");
  5. if (login == "admin") {
  6.     let password = prompt("Enter your password", "here");
  7.     if (password == "admin") {
  8.         console.log("Hola")
  9.     } else if (password == null) {
  10.         console.log("Cancelled")
  11.     } else {
  12.         console.log("Wrong password")
  13.     }
  14. } else if (login == null) {
  15.     console.log("Cancelled")
  16. } else {
  17.     console.log("Undefined User")
  18. }
Advertisement
Add Comment
Please, Sign In to add comment