Skip to content

Instantly share code, notes, and snippets.

@elliotaplant
Created September 2, 2018 16:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elliotaplant/1b545bbc5633907eadad507de26568d7 to your computer and use it in GitHub Desktop.
Save elliotaplant/1b545bbc5633907eadad507de26568d7 to your computer and use it in GitHub Desktop.
var place1 = ['lord', 'master', 'slimiest', 'swampiest', 'grand toad', 'swampy boy'];
var place2 = ['slimy', 'swamply', 'toadly', 'ribbeting', 'croaking', 'fly eating'];
var place3 = ['toads', 'pledges', 'toads', 'basement dwellers'];
function randomItemFromArray(array) {
return array[Math.floor(Math.random() * array.length)];
}
function kurekTheSlimyToad() {
const place1Choice = randomItemFromArray(place1);
const place2Choice = randomItemFromArray(place2);
const place3Choice = randomItemFromArray(place3);
return (`Kurek, ${place1Choice} of the ${place2Choice} ${place3Choice}`);
};
console.log(kurekTheSlimyToad());
console.log(kurekTheSlimyToad());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment