Its either codecademty or me


11. functions recap- javascript

it keeps saying that the syntax wrong... what

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


You have a few things wrong in your code.
First, you don't need an equal sign with your return statement, to return what you are trying to return you would write:

return  "Hi, I am" + " " + name;

Also, returning is the LAST thing you want to do in a function definition, because a return statement stops the function.

Lastly, when calling the function like you did here:


the argument that you are passing it needs to be in quotation marks if it's a string, which yours is.


For this exercise, you need to print the result of the function, so that would look like:



thanks your help is much appreciated


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