Random Answers
Pick a reply.
The Magic 8-Ball! 🎱
Hi fortune teller! 🌟 Have you seen a Magic 8-Ball? You ask a question and it gives a surprise answer! 🎱
Today we make one in code! First step: picking a random answer! 🎲
A List of Answers 📋
First we need a list of replies! 📋
We store many answers in an array (a list in square brackets). 🪄
let answers = ['Yes!', 'No way!', 'Maybe...'];
console.log(answers);All lessons in this course
- Asking a Question
- Random Answers
- Revealing the Fortune
- Add More Answers