Introduction to Functions


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

My console.log is coming up twice. Can someone tell me why?

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


your function logs this string to the console, not returning it


When I use return instead of console.log i get this error...

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?


that is because you only partially did step 4 of the instructions.

console.log() should be used on the function call to log the returned result of the function


im not sure if you understood what he was saying but he basically means that instead of
you are supposed to call the name of the function.
if you already had the answer then whatever.


what do you mean?


I was just trying to clarify it in case he didn't understand, I didn't mean to make it sound like you didn't do a good job at explaining but I noticed that he hadn't replied so I was just trying to simplify it for him. sorry if it came across that way.


okay, but you replied to me?

and also, console.log("susie"); isn't anywhere in andersonkc code, so that is confusing


oh sorry, my bad, I saw namestring("suzie") and thought it was a console.log and I just hit reply on the chat so I didn't mean it for you. just forget my first post. I messed up, sorry


Makes sense. Thank you.


Thank you for explaining.


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