07:31Learn JavaScript WHILE LOOPS in 8 minutes! 🔁
From the creator
// 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"); } }
Published 2023-10-30 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.





