Code is correct output is displayed twice and an error also shown


#1


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

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

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

This is in function recap page:
below is my code and it runs and shows
Hi, I am Susie
Hi, I am Susie
twice and yet shows an error saying
"Oops, try again. Hmm, it looks like your nameString() function doesn't return 'Hi, I am Susie' for the name Susie."

Is any thing wrong in code???


#2

your function logs something to the console, it doesnt return anything?


#3

A post was split to a new topic: 11. function recap


#4

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