It keeps sending me an error when there is none


It returns an error that says my code does not print "Hi, I am Susie" but when I run the code that's exactly what it prints "Hi, I am Susie" but I contiune to get the same message.

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



Instruction #3 says for the function to RETURN the message. You have console.logged it.

You need to console.log the call of the function which is the last line (nameString("Susie");). Not in the function.


I tried just returning the message and then calling the function, It says you did not console.log a message. So I console.log it and it says I didn't return. Its printing exacting what the instructions say, its just keeps saying it wrong when it's not.

this print Susie just fine but complaints that there's no message being logged to the console.

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

The code below, returns the name as undefined, which is what makes me question where is Susie coming from? If I try to pass in my name it prints the message with my name and than returns an error because i didn't print Susie.

var nameString = function (name) {
return "Hi, I am" + " " + name;
The instruction says nothing about Susie, you only find out that you have to print Susie when you run it. Where are these test case coming from?
sorry if this question is silly.


You seem to have skipped over this.
console.log the call such as this:


At the end where you have nameString();.

Actually, now that you ask about Susie (and it isn't a dumb question), Susie is a test case written by Codecademy in the back to test if you're code is working. The reason why it pops up is because they probably have
nameString('Susie') as the first test case and it didn't pass therefore, giving you that error message.

If you do console.log(nameString()); instead of just nameString();, you will pass and that's what the instruction says.


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