11. Functions Recap


#1

var nameString = function (name)
{
return "Hi , I am" + " " + name;
};
nameString = (Susie);
console.log (nameString);
This is my code, but for some reason it says "ReferenceError: Susie is not defined"


#2
nameString = (Susie)

is assigning a value to the nameString, this is incorrect.
if you want to output a function then look the example:

var test = function ( parameter ) {
    return "I am a " + parameter;
}
console.log(test("banana"));
//output
I am a banana

#3

I fixed what you said:

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

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


#4

try below

var nameString= function ( name ) {

return "Hi, I am " +name

};
var xx= nameString("Susie");
console.log(xx);


#5

That is right, codecademy is very strict sometimes on its strings. Your code has a space between "Hi" and a comma, fix that like @h0555923363 said and you should be all done with this one. Next time just copy paste the string so you know you are not doing any mistakes on that part. :relaxed: