11. Functions recap


#1

Hi, I'm currently stuck on this task. I know I've made some stupid mistake, but can't quite figure out what.
My code:

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

The error:
ReferenceError: Eliot is not defined

Thanks.


#2

Hi first you don't have to call it you just need tor print it like that console.log(nameString("Eliot")); also you have to remove the space in return after the "I am " and its should be like that return
"Hi, I am" + " " + name;


#3

Wow, seems so simple now, thanks. :slightly_smiling:


#4

Your welcome I'm glad that I could Help you..