Skip to content

Instantly share code, notes, and snippets.

@AurelieBayre
Created March 23, 2018 08:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save AurelieBayre/db91d3e610d1b3c5f635923911531f20 to your computer and use it in GitHub Desktop.
Save AurelieBayre/db91d3e610d1b3c5f635923911531f20 to your computer and use it in GitHub Desktop.
const getRandomNum = max => Math.floor(Math.random() * Math.floor(max))
const chooseSomeone = (array, role) => {
const index = getRandomNum(array.length)
return `${array[index]} is the ${role}`
}
console.log(chooseSomeone(["Aurelie", "Max", "Thibaut", "Arnaud"], "ScrumMaster"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment