Skip to content

Instantly share code, notes, and snippets.

@youngjinmo
Created November 14, 2018 05:45
Show Gist options
  • Save youngjinmo/163aee848f62659d21ff564ea6b79662 to your computer and use it in GitHub Desktop.
Save youngjinmo/163aee848f62659d21ff564ea6b79662 to your computer and use it in GitHub Desktop.
Answer passed.
/*
* Programming Quiz: Inline Functions (5-6)
*/
// don't change this code
function emotions(myString, myFunc) {
console.log("I am " + myString + ", " + myFunc(2));
}
// your code goes here
// call the emotions function here and pass in an
// inline function expression
emotions("happy", function laugh(num){
var str = "";
for(var i=0; i<num; i++){
str += "ha";
}
return str + "!";
});
// feedback
/*
What Went Well
- Your code should have an emotions() function
- Your code should call the emotions() function
- Your emotions() function call should have an inline function expression passed as the second parameter
- Your emotions() function call should print the correct output
Feedback
Your answer passed all our tests! Awesome job!
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment