FUNCTIONS RECAP error


#1


This is the code I am using for this section and it goes
through but it still comes up as an error for some reason

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


Oops, try again. It looks like you didn't print anything to the console! Did you remember to console.log() the result of passing your name to the nameString() function?

can someone please help me and tell me what the problem is i have also tryd multiple other ways of this code and they dont come up at all at least my shows up
i am lost NEED HELP


#2

Put a space between return and what is is going to be returning... You also need to just call the function, not set console.log equal to it. You can also combine your String into one. Some parenthesis for readability wouldn't hurt either:

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

#3

finally! thank you it works


#4

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