Can anyone help me to write the below code? Question about 11/13


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.


If I gave you the code directly, it would not help you as you can simply copy it. I encourage you to tell us the exact step above wherein you face a problem.


Hi Gaurang,

I have tried and finally i debug my code..

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



That's redundant: as makes clear, all that was necessary is console.log(nameString("Vikram")); -- just one line....

(And as I noted in that thread, I blame Code Academy/Leng Lee [the author of these lessons] for not having considered a beginner's mindset in this exercise.)


Thank You @dc_super_rich for sharing the link..It really help me to clear my concepts..