0Pricing
Javascript for Kids · Lesson

Revealing the Fortune

Reveal the fortune.

Reveal the Fortune! ✨

Welcome back, fortune teller! 🌟 Last time we picked a random answer. 🎲

Now let's reveal the fortune in a magical, fun way! ✨🎱

Show the Chosen Answer 🎯

First, pick an answer and show it! 🎯

We print it with console.log so everyone can see. 🖨️

let answers = ['Yes!', 'No', 'Maybe'];
let pick = Math.floor(Math.random() * answers.length);
console.log('The 8-Ball says: ' + answers[pick]);

All lessons in this course

  1. Asking a Question
  2. Random Answers
  3. Revealing the Fortune
  4. Add More Answers
← Back to Javascript for Kids