Positive Thinking Message Generator

I completed the Mixed Messages as part of the FullStack path and kept my sweet and simple (and have realized after that I could have put the random generator code directly in my message and saved even a few more lines).

It took me about 10-15 minutes to create, but I could add to the word options, or even add in another space where “worry” is. I did spend an additional 10-15 trying to determine why node was throwing an error (turns out I wasn’t exiting before trying to run an additional time so it thought I was trying to redeclare already defined variables, but my code itself was fine).

const emotionOptions = ['happy', 'excited', 'hopeful', 'amazed']; const descriptionOptions = ['bright', 'shining', 'mesmerizing', 'magical']; const objectOptions = ['star', 'opportunity', 'memory', 'experience']; let emotion = emotionOptions[Math.floor(Math.random() * emotionOptions.length)]; let description = descriptionOptions[Math.floor(Math.random() * descriptionOptions.length)]; let object = objectOptions[Math.floor(Math.random() * objectOptions.length)]; console.log(`Don't worry, be ${emotion}. I see a ${description} ${object} on the horizon.`);