Function Recap


#1


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

};
nameString("josh");


#2

Isn't my function supposed to take any name?


#3

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.


#4

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


#5

Try calling it with the name "Susie"


#6

Doesn't work either should I report this bug?


#7

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

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

#8

thats not working either thanks for trying to help though


#9

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()


#10

I found the solution function nameString (name) {
return "Hi, I am " + name;
}
console.log(nameString("Susie"));

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


#11

thanks though for help


#13