Function Syntax


#1

Help I cant get this correct please

// 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 greeting = function (Felix)
{
    console.log("Hey" + "" + name)
}

This is the error I get Oops, try again. You did not call the greeting function. Pass it a name!


#2

    // 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!
    greeting("Felix");

@solarmod I believe your issue is because you remade your console.log which confused the compiler.


#3

Wow thanks that helped me omg omg omg thx


#4

@claradavies I guess by remade your console.log you meant created a new function, right?
And yes that is the problem you just need to call it by e.g. greeting("Felix"); don't have to reinvent the wheel.


#5

Yes @haxor789 that is what I meant.