Last active
August 11, 2021 20:22
-
-
Save VerduzcoTristan/e60b53bc5bcba30978d6279e2da343e1 to your computer and use it in GitHub Desktop.
main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const messages = ["You will have a great deal of luck", "You will find companionship", "You will acquare vast wealth."]; | |
function pickRandomMessage(array){ | |
let random = Math.random(); | |
let index = Math.floor(random * array.length); | |
return array[index]; | |
} | |
console.log(`${pickRandomMessage(messages)}`) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment