Functions recap problem


My code is this:

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

and instead of it printing "Hi, I am Logan" it is printing this: [Function]
What's going on???


Hey Logan,

On line 2 you missed the return statement and the nameString on line 3 needs to be inside your console.log

The final working code should look something like this:

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



Hello I have another problem on same topic..Check image

Here i also tried to change my name "Rushabh" to "Susie" but same problem..

Thanks ..


Thanks for the help, I was not understanding.


there was no mention of "Susie" in the instructions


This has nothing to do with using "Susie". What happens is that the author wrote a few test cases to confirm that your code is working correctly and the first one is to check your code by running nameString("Susie") and inspecting the output and if it doesn't match the expected output of "Hi, I am Susie" you get the error message. So the problem is not your input being "Rushabh" but the output being not "Hi, I am Rushabh". As far as I can see you used both options to add a space which leads to 2 spaces between "am" and "Rushabh" instead of one and that is all it is complaining about. Hope this make it clear.


Oh.. I see ..
Got it Thanks.. :relieved: