Function Syntax


The code just says that there is something wrong with my syntax. It also states that there is an unexpected string. I don't understand what exactly is wrong.

// Below is the greeting function!
// See line 7
// We can join strings together using the plus sign (+)
// See the hint for more details about how this works.

var greeting = function (name) {
    console.log("Great to see you," + " " + name);

// On line 11, call the greeting function!
var sayHello = function("Alexa") {
    console.log('Hello ' + "Alexa");


This is not the same as calling a function. To call a function, just write the function name followed by parentheses. If the function takes an argument, pass it one.



So to call the greeting function, you would write greeting and pass an argument into the parentheses. In this case, the argument would be a text string.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.