🚀 30 Days of JavaScript – Day 11 Continuing my journey of improving JavaScript logical thinking by building small interactive programs. 💡 Mini Project: JavaScript Quiz Game This program asks a few questions and calculates the final score based on the user’s answers. 🧠 Concepts Used: • conditional statements • variables • user input with prompt() • string handling using toLowerCase() 🎥 Demo below 👇 Full source code in the First comment. #JavaScript #CodingChallenge #WebDevelopment #LearningJavaScript #ProblemSolving #30DaysOfCode

let score = 0; // Question 1 let q1 = prompt("What is 2 + 2?"); if (q1 === "4") {  score++; } // Question 2 let q2 = prompt("JavaScript is a ____ language?"); if (q2.toLowerCase() === "programming") {  score++; } // Question 3 let q3 = prompt("Which company created JavaScript?"); if (q3.toLowerCase() === "netscape") {  score++; } // show result alert("Your score is: " + score + " / 3"); // play again let playAgain = confirm("Play again?"); if (playAgain) {  location.reload(); } else {  alert("Thanks for playing!"); }

Like
Reply

Building small projects like this is a great way to improve JavaScript logic and problem-solving skills. The quiz game idea is simple but very effective for practicing conditionals and user input handling. Keep going with the 30 Days of JavaScript challenge — looking forward to seeing the next projects!

Like
Reply
See more comments

To view or add a comment, sign in

Explore content categories