You did not give function name, pass it a name!


So I believe I have debugged this:

greeting var func{name}(console.log(name)))}

correctly to this:

var greeting = function(chocolate)

and it told me to pass it a name, which I have, I called it chocolate, yet it still doesn't work and gives same error!



the FUNCTION talk

var myFunc = function( param1, param2) {
       //Begin of  anonymous FUNCTION-BODY
       //VARIABLE -myFunc- has an -anonymous function- assigned
       //this -anonymous function- has 2 PARAMETERS param1 and param2
       //param1 and param2 PARAMETERS are used 
       //as -local- VARIABLES throughout the FUNCTION-BODY

      console.log( param1 + " and " + param2 ) ;

      //End of anonymous FUNCTION-BODY

If you want to call/execute the anonymous function
you will have to add a pair of parentheses to the variable myFunc
As the anonymous function was defined
as having 2 parameters
you have to provide 2 arguments
in our case 2 string VALUES "Alena" and "Lauren"

some quotes from the outer-world:

**argument is the value/variable/reference being passed in,
parameter is the receiving variable used within the function/block**


**"parameters" are called "formal parameters",
while "arguments" are called "actual parameters".**


With your

var greeting = function(chocolate) {

you have assigned an anonymous Function
to the variable greeting.

This anonymous Function takes 1 parameter chocolate

Within the FUNCTION-BODY of this anonymous Function
the chocolate parameter will be seen and used as a local variable.

If you want to call this anonymous Function
you will have to add a pair =parentheses= ( ) to the greeting variable


but as the anonymous Function was defined as having 1 parameter chocolate
you will have to provide 1 argument in this case a =name= as a string Value


PS. It might be that the Instructions require you to use a specific-output-string......


When I attempt to input atleast 1 argument it states an error: SyntaxError: Unexpected identifier
This problem however does not appear when I do not have that 1 argument, also adding a pair of parentheses to the greeting variable just warps how greeting(); is taken and instead of greeting being blue, (before adding parentheses), it is now white, and it has an error saying Unexpected Token (
I haven't tried combining them, but I heavily suspect errors.
PS. It just says to pass greeting a name. It just states: Oops, try again. You did not call the greeting function. Pass it a name!


Present the code you are using which causes the SyntaxError: Unexpected identifier


var greeting = function(chocolate)

If that's what you meant by the one argument. Also, changing what's in the quotation marks within the arguments change nothing.


I meant...

var greeting = function(chocolate)



Thank you so much, I was so confused on this one.


Read through the Function talk....!!!