Created
November 14, 2018 05:45
-
-
Save youngjinmo/68d38fca8978b2f0f6f413f7c3525244 to your computer and use it in GitHub Desktop.
My first try, but failed. Because I missed using an inline function that function passed the another function.
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
/* | |
* 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 | |
var laugh = | |
function(num) { | |
var str = ""; | |
for(var i=0; i<num; i++) { | |
str += "ha"; | |
} | |
return str+"!"; | |
} | |
emotions("happy", laugh); | |
// feedback | |
/* | |
What Went Well | |
- Your code should have an emotions() function | |
- Your code should call the emotions() function | |
- Your emotions() function call should print the correct output | |
What Went Wrong | |
- You didn't pass an inline function expression to the emotions() function | |
Feedback | |
Not everything is correct yet, but you're close! | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment