Message-Generator Using javascript

###l build a message generator program. Every time a user runs a program, they should get a new, randomized output.

######I’m going to post the code and help me if this is the best way to solve it.

######const messages = [“Love all, trust a few, do wrong to none”, “You call it madness, but I call it love”, “We can only learn to love by loving”, “A life lived in love will never be dull”, “Life is the flower for which love is the honey”]

const generateMessage = () => {
const randomIndex = Math.floor(Math.random() * messages.length);
randomMessages = messages[randomIndex];
console.log(randomMessages)
};

generateMessage()

Thank you, this is my first time posting.

looks good

Remember to post code using the </> button and the paste it on lines between the ``` and ``` so your code keeps its formatting in the post.

Alright, i will try that.
Thanks. Cheers!