I need help with JS


#1

My code Looks correct,(don't know If It is),But An error keeps popping up

var sayHi = function (SayHello) {
    console.log("Great to see you," + " " + "John");
};

And after I try It,This error pops up:
Oops, try again. You did not call the greeting function. Pass it a name!

Help?


#2

This error message tells us two things:

Oops, try again. You did not call the greeting function. Pass it a name!

First of all you need to call a function for which the syntax is:

functionName();
functionName( argument(s) );

where arguments (is) are just values and their number should correspond to the number of paramters. So in your case as you hava one parameter you might call:

sayHi("John");

This would give your sayHello parameter a value of "John" when your function gets executed. Btw it would be a good idea to use this parameter and not to hard code "John" in your code.

And the other thing the error message tells us is that the name of the function should be greeting and not sayHi.
Normally you're free to name your variables as you like, but there is a test function that might values of variables of which the name is mentioned in the instructions.

Hope this helps you a bit.