Created
September 2, 2018 16:40
-
-
Save elliotaplant/1b545bbc5633907eadad507de26568d7 to your computer and use it in GitHub Desktop.
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
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