Final Score
Show results.
Final Score 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.
The Big Reveal! 🏁
The quiz is over! Now we show the player their final score with a fun message. 🏁🎉
console.log('Quiz finished! 🏁')Print the Score 📢
First, let's just announce the number of points. 📢
let score = 4
console.log('Your final score is', score)Out of Total 🔢
Show it as score out of total so it makes sense! 🔢
let score = 4
let total = 5
console.log('You got', score, 'out of', total)A Cheer for Winners 🎉
If the player got everything right, give a big cheer! 🎉
let score = 5
let total = 5
if (score === total) {
console.log('PERFECT! You are a genius! 🧠🏆')
}Different Messages 🗨️
We can show different messages for different scores using if and else. 🗨️
let score = 3
if (score >= 3) {
console.log('Great job! 🌟')
} else {
console.log('Keep practicing! 💪')
}Star Rating ⭐
Let's give stars based on the score. More points means more stars! ⭐⭐⭐
let score = 5
if (score === 5) {
console.log('⭐⭐⭐ Amazing!')
} else if (score >= 3) {
console.log('⭐⭐ Good!')
} else {
console.log('⭐ Try again!')
}Make a Percent 💯
We can turn the score into a percent: score / total * 100. 💯
let score = 4
let total = 5
let percent = score / total * 100
console.log('You scored', percent, 'percent!')Pass or Fail 🚦
Many quizzes have a pass line. Let's say you pass at half or more! 🚦
let score = 3
let total = 5
if (score >= total / 2) {
console.log('You PASSED! 🎉')
} else {
console.log('Not yet, try again! 🔁')
}Result Function 🛠️
Let's build a helper that shows the result for any score! 🛠️
function showResult(score, total) {
console.log('Score:', score, '/', total)
if (score === total) console.log('Perfect! 🏆')
}
showResult(5, 5)A Friendly Goodbye 👋
End the quiz with a kind message so players want to come back! 👋
console.log('Thanks for playing! 🎮')
console.log('See you next time! 👋')Full Final Screen 🎉
Here is a complete ending screen with score, stars, and a goodbye! 🎉
let score = 4
let total = 5
console.log('Math Quiz Complete! 🏁')
console.log('Score:', score, '/', total)
if (score >= 3) console.log('⭐⭐ Well done!')
console.log('Bye! 👋')Quick Check ✅
One last quiz question for you! 🧠
Quiz Champion! 🏆
WOW! You built a whole Math Quiz Challenge! 🎉
- Made questions ❓
- Checked answers ✅
- Kept score 🏆
- Showed the final result 🏁
You are a real coder now! 🌟
console.log('Math Quiz Challenge: COMPLETE! 🏆🌟')Frequently asked questions
Is the “Final Score” lesson free?
Yes — the full text of “Final Score” 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 “Final Score”?
Show results. 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 “Final Score” 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.