Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as JavaScript by kris ( 8 years ago )
/*
 * Programming Quiz: Inline Functions (5-6)
 */

// don't change this code
function emotions(myString, myFunc) {
    console.log("I am " + myString + ", " + myFunc(4));
}

// your code goes here
// call the emotions function here and pass in an
// inline function expression
var laugh = function(max){
    var sound = "";
    for (i = 0; i<max; i++){
        sound += "ha"; 
    }
    return sound + "!";
};

emotions("happy",  laugh);

 

Revise this Paste

Children: 90670
Your Name: Code Language: