Add More Answers
Customize replies.
Add More Answers 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.
Add Your Own Answers! ✏️
Hi fortune master! 🌟 You can pick and reveal answers. 🎱
Now let's make the 8-ball YOURS by adding your own funny replies! ✏️😄
Look at the Answer List 📋
Our answers live in an array (list)! 📋
We can add as many as we like. The more, the merrier! 🎉
let answers = ['Yes!', 'No', 'Maybe'];
console.log(answers);Add One More Answer ➕
Use push to add a new answer to the end! ➕
It's like dropping a new card on the pile. 🃏
let answers = ['Yes!', 'No', 'Maybe'];
answers.push('Absolutely! 🎉');
console.log(answers);Add Several Answers 🎒
Keep pushing to add lots of answers! 🎒
Make them silly and fun! 🤪
let answers = ['Yes!', 'No'];
answers.push('Ask a cat 🐱');
answers.push('In your dreams! 😴');
answers.push('Totally! 🌟');
console.log(answers);Make a Funny List 😂
Write your own funny answers right in the list! 😂
This is your personal magic 8-ball! 🎱
let answers = ['Way cool! 😎', 'No chance! 🙅', 'Maybe pizza? 🍕', 'Ask later 🕐'];
console.log(answers);Pick From Your Big List 🎯
Now pick a random answer from your bigger list! 🎯
.length handles any size automatically. 💡
let answers = ['Way cool! 😎', 'No chance! 🙅', 'Maybe! 🤔', 'For sure! ⭐'];
let pick = Math.floor(Math.random() * answers.length);
console.log(answers[pick]);Add Then Ask 🔮
Add a new answer, then ask the 8-ball! 🔮
Your new reply might be the one chosen! 😲
let answers = ['Yes!', 'No', 'Maybe'];
answers.push('Super yes! 🎊');
let pick = Math.floor(Math.random() * answers.length);
console.log('🎱 ' + answers[pick]);Count Your Answers 🔢
Let's see how many answers you have now! 🔢
.length tells us the count. 📏
let answers = ['Yes!', 'No', 'Maybe', 'For sure', 'Nope'];
console.log('I have ' + answers.length + ' answers! 🎉');Your Custom 8-Ball Machine 🤖
Build a function using your custom answers! 🤖
Call it to ask your one-of-a-kind 8-ball! 🎱
let answers = ['Totally! 🌟', 'No way! 🙅', 'Maybe tomorrow 🌙', 'Ask your dog 🐶'];
function ask() {
let pick = Math.floor(Math.random() * answers.length);
console.log('🔮 ' + answers[pick]);
}
ask();Your Complete Magic 8-Ball 🎊
Here is your finished custom 8-ball! 🎊
Add or change answers to make it perfectly YOU! 🌟
let answers = ['Yes! 🎉', 'No! 🙅', 'Maybe! 🤔'];
answers.push('Ask a unicorn 🦄');
function ask(question) {
let pick = Math.floor(Math.random() * answers.length);
console.log('❓ ' + question);
console.log('🎱 ' + answers[pick]);
}
ask('Will I have fun today?');You Added Your Own Answers! 🏆
Amazing, fortune master! 🏆 You learned to:
- ➕ Add answers with
push - 📋 Write your own funny replies
- 🤖 Build a custom 8-ball function
You finished the Magic 8-Ball course! 🎉🎱
Quick Check ✅
Brain time! 🧠 How do we add a brand new answer to our list?
Lesson Recap 🎀
Super job, 8-ball master! 🎀 Today you learned:
- ➕
pushadds new answers - 📋 Write your own replies
- 🤖 Make it a custom function
You built your own Magic 8-Ball! 🎱
Frequently asked questions
Is the “Add More Answers” lesson free?
Yes — the full text of “Add More Answers” 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 “Add More Answers”?
Customize replies. 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 “Add More Answers” 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
- Asking a Question
- Random Answers
- Revealing the Fortune
- Add More Answers