I dont get why this code doesn't work but still works


#1

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

nameString("Susie");


#2

Hi,

your function returns and console.logs something. For the lesson you need a function that only returns the required string. Then you console.log the result of calling the function with your name in line 6.

E.g.

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

#3

As you exit the function on return placing any code after it will simply be ignored.