Need help with calling functions


#1

var greeting = function (Willy) {
console.log("Hey" + " " + "you");
};

// On line 11, call the greeting function!
sayHello("Willy");

What in gods name am i doing wrong?!!


#2

Hi,

you try to call a function names sayHello() where in your Code did you declare this function?

Your function greeting has a parameter called Willy. Willy is now to handle like a variable

console.log("Hey" + " " + "you");

Gives you only "Hey you" as result

If you change that code to

console.log("Hey " + Willy + " you");

and call this function like this:

greeting("David");

you get the result "Hey David you"