Learn JavaScript WHILE LOOPS in 8 minutes! 🔁

preview_player
Показать описание
// while loop = repeat some code WHILE some condition is true

let loggedIn = false;
let username;
let password;

while(!loggedIn){

if(username === "myUsername" && password === "myPassword"){
loggedIn = true;
}
else{
}
}
Рекомендации по теме
Комментарии
Автор

// while loop = repeat some code WHILE some condition is true

let loggedIn = false;
let username;
let password;

while(!loggedIn){
username = window.prompt(`Enter your username`);
password = window.prompt(`Enter your password`);

if(username === "myUsername" && password === "myPassword"){
loggedIn = true;
console.log("You are logged in!");
}
else{
console.log("Invalid credentials! Please try again");
}
}

BroCodez
Автор

bro thank you very much, your videos help a lot to quickly and easily understand various topics, Greetings from Russia. And I would like to know when there will be courses in C#

tgvsmie
Автор

<*_> This is my seal. I have watched the entire video, understood it, and I can explain it in my own words, thus I have gained knowledge. This is my seal. <_*>

piotrmazgaj
Автор

that was cool and informative . thanks buddy

hamedjafarian
Автор

hey, you didn't say, what's up everybody? This is your bro here.

ghulammujtaba
Автор

Hey bro please what is the difference between this tutorials and the previous one ??

okbabacha
Автор

Can you explain me what this code ""${username}"" means

Lucas-rrel