Problems with 11. Function Recap


#1


Don´t understand what I´m doing wrong with the following Code:

var nameString = function (name) {
return "Hi, I am" + " " + name;
};

console.log = nameString("John");


I always get the following Error-Message:
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?


Replace this line with your code.


#2

HI this line

console.log = nameString("John");

remove

console.log =

then resfresh the page.


#3

disagree?

the error message clearly indicate you need to use console.log() on the function call, since the function is returning something?

@loomag, console.log() uses parentheses, the function call should be between the parentheses of console.log()


#4

Thank You.
But when I remove
console.log=
I get the following message:
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?


#5

Now you should do what @stetim94 said.. then refrresh the page


#6

Whats wrong in this code??? i got error message.
var nameString = function (name ) {
return "Hi,I am" + " " + name;
};
nameString("Nusrath");
console.log(nameString("Nusrath"));


#7

strings returned need to be an exact match, you miss a space between Hi, and I


#8

Please replace by using console.log(nameString("John"));


#11

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