A Simple Quiz Checker
Check answers using booleans.
A Simple Quiz Checker is a free Javascript for Kids lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Javascript for Kids learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Build a Quiz! 🎯
Let us build a tiny quiz checker! 🧠
It will check if an answer is right using booleans. ✅
The Secret Answer 🤫
First, we save the correct answer in a box. 📦
let correct = "blue";
console.log("Answer saved!");The Player Guesses 🙋
Now the player picks an answer. We save it too! ✍️
let correct = "blue";
let guess = "blue";
console.log("Guess: " + guess);Check It! 🔍
We use === to see if the guess matches the correct answer! 🟰
let correct = "blue";
let guess = "blue";
console.log(guess === correct);Right or Wrong? 🤔
If they match, we get true (correct!). If not, false (try again!). 🎉
A Wrong Guess 😅
Watch what happens when the guess is wrong. 🟢
let correct = "blue";
let guess = "red";
console.log(guess === correct);Make a Checker Spell 🪄
Remember functions? Let us put our checker in a spell! ✨
function check(guess) {
return guess === "blue";
}
console.log(check("blue"));Test Many Guesses 🎲
Now we can test lots of guesses with our spell! 🎉
function check(guess) {
return guess === "blue";
}
console.log(check("green"));
console.log(check("blue"));Add a Friendly Message 💬
Let us make it say nice words depending on the answer! 😊
function check(guess) {
if (guess === "blue") {
return "Correct! Great job!";
}
return "Oops, try again!";
}
console.log(check("blue"));You Built a Quiz! 🏗️
You used booleans, comparisons, AND a function together! 🤝
That is real coding magic. 🧙
So Many Tools! 🧰
See how everything works together? Booleans, questions, and spells make games! 🎮
You are doing amazing! 🌟
Quick Check 🧠
Final question for this course! 🎯
Quiz Wizard! 🏆
Hooray! You built a quiz checker with booleans! 🎊
Next up: random fun and surprises! So exciting! 🚀
Frequently asked questions
Is the “A Simple Quiz Checker” lesson free?
Yes — the full text of “A Simple Quiz Checker” is free to read here on the web, and the Javascript for Kids course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Javascript for Kids course, upgrade to CoddyKit PRO.
What will I learn in “A Simple Quiz Checker”?
Check answers using booleans. You practise Javascript for Kids with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Javascript for Kids?
No prior experience is required. Javascript for Kids on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “A Simple Quiz Checker” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Javascript for Kids lesson?
Yes. Every Javascript for Kids lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- True and False
- And, Or, Not
- Asking Yes or No Questions
- A Simple Quiz Checker