Lesson 11:Functions Recap....who is Susie?


#1

why does this name can appear in here ?


#2

When you submit your code the a few tests are run to see if this is working an one of these test seems to be something like this:

if ( nameString("Susie") === "Hi, I am Susie")

And as your code doesn't return a value but only console.log one this will not work and you get the error message. But don't get to the common but false assumption that using "Susie" as the name would change anything, if it works for your name it will work for Susie as well.


#3

Hello, I found another easier way:

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

};
nameString("Robert Michum");
console.log("Robert Michum");

The output WAS perfect!!!


Introduction to Functions in JS: 11. Functions recap
#4

Instead of console.log("Robert Michum"); better just wrap your function call in a console.log.


#5

I had the same problem until I put the return in on line 3 to read" return blank = "Hi, I am" + " " + name; after declaring Blank a global var before function.then console.log(blank);


#6

Sound interesting although I'm almost certain that the blank is redundant in this case. Could you post it with Spoiler or details tags?

code

[spoiler]code[Spoiler]

hint

code

[details=hint]code[/details]

#7

this is how the code should look like


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

#8

Thanks for preparing me 4 next one still stuck on 10 though help please. wait, nevermind.