What am I doing wrong, with this Java Script?


#1



Hello - I am new at writing Java Script.

I get this message with my code. ( See code below).
Oops, try again. Hmm, it looks like your nameString() function doesn't return 'Hi, I am Susie' for the name Susie.

Is there anyone that can tell me what am i doing wrong?

https://www.codecademy.com/courses/javascript-beginner-en-6LzGd/2/3?curriculum_id=506324b3a7dffd00020bf661
My code:

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

#2

In your function you are supposed to use are return statement and not a console.log(),

should be,

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

And also you are instructed to use console.log when calling your function so instead of,

console.log(nameString("Susie"))


#3

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