-
-
Save sethschori/cfaeae0a4c5abd3f74b043d9e2e75ae2 to your computer and use it in GitHub Desktop.
https://repl.it/CSoW/81 created by sethopia
This file contains hidden or 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
/* | |
NAME GAMES | |
Create two functions, sayMyName() and playNameGame() | |
sayMyName() will take 2 arguments: a first name and a last name. It will log out the string "My name is FIRSTNAME LASTNAME" | |
sayMyName("Dan", "The Man") ==> "My name is Dan The Man" | |
playNameGame() will take a person's first name. It will log out a string of the name game song | |
playNameGame("Daniel") ==> "Daniel Daniel Bo Baniel Banana Fana Fo Faniel Fee Fi Mo Maniel Daniel" | |
*/ | |
function sayMyName (fname, lname) { | |
console.log("My name is",fname,lname); | |
} | |
function playNameGame (fname) { | |
var stem = fname.slice(1); | |
console.log(fname,fname,"Bo B"+stem,"Banana Fanana Fo F"+stem,"Fee Fi Mo M"+stem,fname); | |
} | |
sayMyName("Dan", "The Man"); | |
playNameGame("Daniel"); | |
playNameGame("Seth"); |
This file contains hidden or 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
Native Browser JavaScript | |
>>> My name is Dan The Man | |
Daniel Daniel Bo Baniel Banana Fanana Fo Faniel Fee Fi Mo Maniel Daniel | |
Seth Seth Bo Beth Banana Fanana Fo Feth Fee Fi Mo Meth Seth |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment