Its either codecademty or me


#1


11. functions recap- javascript


it keeps saying that the syntax wrong... what


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


#2

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:

nameString(abe8635);

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


#3

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

console.log(nameString("Kylea"));

#4

thanks your help is much appreciated


#5

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