I'm stuck on Lession 11 Functions Recap( And I'm going mad


#1

So, this section ask us to
1 Write a function called nameString()
2 It should take name as a parameter.
3 The function returns a string equal to "Hi, I am" + " " + name.
4 Call nameString() by passing it your name, and use console.log to print the output.

And here's what I wrote:

var nameString = function ( name) {
return "Hi, I'm"+" "+name;

};
nameString("Jane");
console.log(nameString);

But the system told me that : It looks like your nameString() doesn't return 'Hi, I'm Susie' for the name Susie.

And I'm so confused. What did I do wrong? :frowning:


#2

Hi here

return "Hi, I'm"+" "+name;

You should write it like that

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

#3

You need to call it in a log.

var nameString = function(name) {
return "Hi, I'm" +" "+ name;
};
console.log(nameString("Jane!");

#4

Oh! problem solved!! Thank you!!