Functions recap error


Hi all,

So I am currently on lesson 11 on functions in JS, but I can't figure out how to fix my error. It says that I didn't print anything to the console! Here is my code:

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


Currently, I just don't know how to fix this, and it would be appreciated if you could help me out.



You use return, and not console.log()


What do you mean by that? I am using return in my function.


And the error says you need to use console.log()


For what though? To call the function?


No, to log "Hi, I am" + " " + name; to the console, rather then return it


Thanks for replying. But when I use console.log in the function, it also gives me an error. Why is this so?


My mistake, return was correct. I hadn't expect the lesson to do this. use console.log() on the function call (last line) and restore your return in your function


It works now. Thanks so much!