Magic 8 Ball : Frontend Coding Exercise

This is where you can share your code for solving the Magic 8 Ball exercise :slight_smile:

This is a fun one. I’m curious how many people are going with a simple array and Math.random() versus something fancier like a weighted list of responses. For the basic version, it’s just a quick:

const responses = ["Yes", "No", "Maybe"];
const randomIndex = Math.floor(Math.random() * responses.length);
const answer = responses[randomIndex];

I’m lowkey tempted to try a version where “outlook good” shows up more often than "don’t count on it. " Maybe next time!