Learn JavaScript WHILE LOOPS in 8 minutes! 🔁

// 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");
}
}

Пікірлер: 16

  • @BroCodez
    @BroCodez9 ай бұрын

    // 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"); } }

  • @theorange6460
    @theorange64604 ай бұрын

    “HELP!” - Bro Code

  • @user-tg5vs5mi7e
    @user-tg5vs5mi7e7 ай бұрын

    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#

  • @ghulammujtaba9236
    @ghulammujtaba92367 ай бұрын

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

  • @genesisvillaranda350
    @genesisvillaranda3507 ай бұрын

    Nice!

  • @okbabacha693
    @okbabacha6937 ай бұрын

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

  • @Efootball_legend04
    @Efootball_legend047 ай бұрын

  • @user-mk2md9pu5m
    @user-mk2md9pu5m7 ай бұрын

    Do django next

  • @Lucas-rr7el
    @Lucas-rr7el7 ай бұрын

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

  • @EledeRR

    @EledeRR

    7 ай бұрын

    Its a placeholder, you need to use `` instead of "" to use it

  • @naufalnasrullah6965
    @naufalnasrullah69657 ай бұрын

    im still waiting postgres videos :(

  • @user-mk2md9pu5m
    @user-mk2md9pu5m7 ай бұрын

    Do django pls

  • @SkyySensei
    @SkyySenseiАй бұрын

    3:19

  • @elitegaming8565
    @elitegaming85657 ай бұрын

    DJANGO course Pls

  • @user-mk2md9pu5m
    @user-mk2md9pu5m7 ай бұрын

    Do django next

  • @user-mk2md9pu5m
    @user-mk2md9pu5m7 ай бұрын

    Do django next