Number 11 on Introduction to Functions has a bug


Whenever I submit code to say "Hi, I'm Fred" it will show that, and then right below it, it will show: "Hi, I'm Susie" I don't know anyone named Susie, and I did not code that part. It will show up with an error message after that.


please copy and paste the error message here.
and show us your code.



I am having the same problem.

var nameString = function (name) {

console.log ("Hi, I am" + " " + name)

nameString ("Buttercup");

When the above code runs, I get
Hi, I am Buttercup
Hi, I am Susie

The error message states:
Oops, try again.
Hmm, it looks like your nameString() function doesn't return 'Hi, I am Susie' for the name Susie.

I know I'm missing something about the return command, but where the heck did Susie come from?



Cause you two didnt read carefully the instructions

Your function should return something and dont print something.

This is wrong

var nameString = function (name) {

console.log ("Hi, I am" + " " + name)



Susie is an example how it should looks like :smile:


So what is the fix? I did read the instructions.
Thank you kindly.

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

And Susie is gone :wink:


try inserting Susie into the function call like this: nameString("Susie");
I believe that it outputs Hi I'm Susie to compare your output to the output they want.


Thank you! Now it makes sense.
I wish there was a way to go back to previous lessons or show previous learning to refer to.



There you can switch


Thanks! That helped a lot!


Yeesh. This lesson really kicks it up a notch. I feel like lesson 8 kinda skims over how important 'return' is when defining a function =/