#3 Introduction Funcion syntax help


#1

I can seem to get it right, i do what i it says but it still says i'm wrong. I've tied in differeant ways
this was my last attempt...

var nameString = function (name ) {
return "Hi,I am" + " " + name
};

nameString("Luis");


#2

you need the colon after name not the curly bracket.

like this:
var nameString = function (name) {
return "Hi, I am" + " " + name;
}

                nameString("Luis")

#3

return "Hi, I am" + " " + name;

you needed a semi colon at the end ;


#4

I tried it and it still says this: Oops, try again. You did not call the greeting function. Pass it a name!


#5

it's because you changed the variable name it should be

var greeting = function(name) {
console.log( "Hi, I am" + " " + name);
};
greeting("Chris")

#6

technically your function is good it will work just not for their test case. if you ran yours in your console using chrome developer tools it would work. It is a little off syntactically but functional as is


#7

Thanks! Also thanks for the quick info!


#8

no problem so did this help? if so could you hit the solution button below the response this way people know that this has been resolved!


#9

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