11 Functions recap help


What’s wrong with my code?

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


Hi this part

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

Remove the " after name


whats wrong with my code

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

its showing ReferenceError: namestring is not defined


inide your console.log you wrote namestring instead of nameString


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”)


Solved it! Was the stupid space after the “am” in the return statement. [quote=“mitchdueck, post:5, topic:30960”]
"Hi, I am " + " " + name;
Tweaked it up a bit during my trouble shooting:
var nameString = function (name) {
return (“Hi, I am” + " " + name);

console.log (nameString (“Mitch”));


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

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


says that namestring doeant return hi i am susie for the name susie


Hi your string should be like that

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

withe the uppercase H and I


“( )” - don’t use these brackets with RETURN :slight_smile:


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


Hi guys!

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

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




Hey swammy!, ///i think you end you syntax in a bad way. Try this:


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


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



Thanks !!

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