Functions Recap


For some reason the only way that this code works is if I input my name as name. If I input anything else it does not work and gives me the error that the name I put was undefined.

How do I change it so that it does not have this problem? (I feel like the answer is really something stupidly simple.)

Thanks for any help.

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



Instead of putting name as the argument for the nameString function, use a text string(any word inside quotation marks).


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


Did your code let you pass through to the next exercise?


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.