DEV Community

JEGADESHWARAN B
JEGADESHWARAN B

Posted on

Login Access Check

you have:
username
password
isBlocked(boolean)
allow login only if:
username is "admin"
password is "1234"
user is not blocked
otherwise print appropriate message.

let username= "admin";
let password = "1234";
let isblocked = true;

if(username==="admin" && password==="1234"){
if(isblocked){
console.log("user is blocked");
else{
console.log("logged in");
}
else{
console.log("username or password incorrect");
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)