11 Functions recap help


#1

What's wrong with my code?

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


#2

Hi this part

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

Remove the " after name


#3

whats wrong with my code

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

its showing ReferenceError: namestring is not defined


#4

inide your console.log you wrote namestring instead of nameString


#5

What does codecademy want? I entered this and it printed out exactly what it wants, but it doesn't let me through.

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


#6

Solved it! Was the stupid space after the "am" in the return statement.

Tweaked it up a bit during my trouble shooting:
var nameString = function (name) {
return ("Hi, I am" + " " + name);
};

console.log (nameString ("Mitch"));


#7

what is wrong in this code:
var nameString = function(name) {

return ("hi, i am"+" "+name);

};

console.log(nameString("akanshya"));
says that namestring doeant return hi i am susie for the name susie


#8

Hi your string should be like that

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

withe the uppercase H and I


#9

"( )" - don't use these brackets with RETURN :slightly_smiling:


#10

thanks a lot @wizmarco ...and @abygrwl29 rwl29 it doesnt matter if we put brackets or not...return type takes bracket in java and c...i know its different..still...thanks a lot


#11

Hi guys!

Does anybody knows why when I call this way it doesn't work?

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

nameString("Rodrigo")
console.log(nameString)

Thanks


#12

Hey swammy!, ///i think you end you syntax in a bad way. Try this:
console.log(nameString("Rodrigo"))


#13

Hi its becasue they aske your to put the call function inside the console() this one

nameString("Rodrigo")

and you put the name of the function inside the console.log()

console.log(nameString)

#14

Thanks !!

I didn't get they were asking for that. Sometimes is a bit confusing.