Skip to content

Instantly share code, notes, and snippets.

@CodeOfficer
Last active August 12, 2018 18:19
Show Gist options
  • Save CodeOfficer/d2c4dd218d4a2c82ceab29662ba1f6c5 to your computer and use it in GitHub Desktop.
Save CodeOfficer/d2c4dd218d4a2c82ceab29662ba1f6c5 to your computer and use it in GitHub Desktop.
Dad Jokes
const dadJokes = {
random() {
return this.jokes[Math.floor(Math.random() * this.jokes.length)];
},
jokes: [
"Did you hear about the restaurant on the moon? Great food, no atmosphere.",
"What do you call a fake noodle? An impasta.",
"How many apples grow on a tree? All of them.",
"Want to hear a joke about paper? Nevermind, it's tearable.",
"I just watched a documentary about beavers. It was the best dam show I've ever seen.",
"Why did the coffee file a police report? It got mugged.",
"How does a penguin build it's house? Igloos it together.",
"Dad, did you get a haircut? No I got them all cut.",
"What do you call a Mexican who has lost his car? Carlos.",
"Dad, can you put my shoes on? No, I don't think they'll fit me.",
"Why did the scarecrow win an award? Because he was outstanding in his field.",
"Why don't skeletons ever go trick or treating? Because they have no body to go with.",
"I'll call you later. Don't call me later, call me Dad.",
"What do you call an elephant that doesn't matter? An irrelephant",
"Want to hear a joke about construction? I'm still working on it."
]
};
function ammoForYourArsenal( n ) {
console.log('•', dadJokes.random());
if ( n === 1 ) {
return 1;
}
return ammoForYourArsenal( n - 1 );
}
ammoForYourArsenal(numberOfKids = 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment