Function Recap


Introduction to Functions in JS .11 Function Recap

Error -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); 	



Isn't my function supposed to take any name?


Your function should be able to take any name. Try removing the function call at the end, as that may be throwing off the output checker.


When I don't call it , I get another error saying Oops try again. Did you call the nameString() function?


Try calling it with the name "Susie"


Doesn't work either should I report this bug?


Your code looks correct... Try this notation for a function:

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


thats not working either thanks for trying to help though


have a look at the instruction again

Call nameString() by passing it your name, and use console.log to print the output.

so you have to call the function inside console.log()


I found the solution function nameString (name) {
return "Hi, I am " + name;

I switched out console.log for return inside the function and called the function with console.log


thanks though for help