tubeshowcase●1,194,391 videos♡ My collection 0
← Learn to Code

Learn to Code08:12

Learn JavaScript WHILE LOOPS in 8 minutes! 🔁

Bro Code ↗

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.

Keep exploring Learn to Code