Try this:
// Output: // Loop number: 1 // Loop number: 2 // Loop number: 3 // Loop number: 4 // Loop number: 5 Let’s put everything together. Open your console and type this: javascript beginner bootcamp (2020)
let hour = 14; // 2 PM if (hour < 12) console.log("Good morning, coder!"); else if (hour < 18) console.log("Good afternoon! Keep typing."); else console.log("Evening coding session? Nice."); Try this: // Output: // Loop number: 1
In 2020, we don’t use var anymore (long story, full of bugs). We use let and const . (happy, tired, confused)"); if (mood === "happy") console
const askMood = () => let mood = prompt("How are you feeling today? (happy, tired, confused)"); if (mood === "happy") console.log("🎉 Keep that energy! JS is fun when you're happy."); else if (mood === "tired") console.log("☕ Take a 5-min break. Coffee helps. So does sleep."); else if (mood === "confused") console.log("🤔 That's normal! Confusion is the first step to understanding."); else console.log("📝 Whatever you're feeling, keep coding. You've got this.");