Function Recap issue


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

I'm really stuck on what i'm doing wrong here.


the console.log after the return statement can never be reached as you leave the function on return. What is the error message about this?


Oops, try again. It looks like you didn't print anything to the console! Did you remember to console.log() the result of passing your name to the nameString() function?


Ok well in this case get rid of the console.log inside of the function as it is as said pointless and wrap your function call in a console.log:



so is the "Hi, I am" + " " + name; part nowhere in the answer? does step 3 just lay out an assumption?


What do you mean with this?


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


this should work


Please do not post solutions. This exercises should be doable and if not mention why instead of spoiling them. Rather give hints or short snippets that explain the problem and how to solve it. Also if you post code please format it in a readable way. Backticks before and after it for inline code or 3 backtics before and after for syntax highlighting or 4 spaces for indented blocks. Also marking your code and using CTRL+SHIFT+C works (maybe add a blank line to top and bottom if necessary).

Last but not least when you execute it like this:


the value of nameString("Dan") triggers one signal that lets you pass but the value you compute here is never used. And console.log(nameString); prints the function name which means that you'll see something like [Function] which is correct as it is a function but is probably not what you wanted to see. So better use:


as explained above. Thank you.