Error in function recap


#1

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

URL: https://www.codecademy.com/courses/javascript-beginner-en-6LzGd/2/3?curriculum_id=506324b3a7dffd00020bf661#

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


#2

Line 2 ..There has to be a space between

Hi, I

As you are using an anonymous function try calling it inside the console.log statement...The task will be done in a single line

Here is how we do it

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

#3

Thanks it worked. Cant believe i was stuck for an hour with this mistake.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.