Created
May 20, 2019 23:25
-
-
Save jennz0r/719b3b64b6cb2f6ddb484d96656d9b87 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
function joke(question, ...phrases) { | |
console.log(question); | |
for (let i = 0; i > phrases.length; i++) { | |
console.log(phrases[i]); | |
} | |
} | |
let es6Joke = "Why does JS single out one parameter?" | |
joke(es6Joke, "Because it doesn't", 'really like', 'all the REST of them!'); | |
// Why does JS single out one parameter? | |
// Because it doesn't | |
// really like | |
// all the REST of them! |
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
def pirate_joke(question, *args): | |
print question | |
for arg in args: | |
print arg | |
python_joke = "What's a Pyrate's favorite parameter?" | |
pirate_joke(python_joke, "*args!", "*arrgs!", "*arrrgs!") | |
# What's a Pyrate's favorite parameter? | |
# *args! | |
# *arrgs! | |
# *arrrgs! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment