Stuck on 11


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

My code works and appears on screen, However the message says "looks like you didn't print anything to the console" Even though I did!!


Return statements are tricky. You only use them in functions. They don't actually display something in the console. That's why console.log statements exist. For example, let's say you have a function:

var function1= function(){
return 1+1;

Calling function1 would return 2 but nothing would log to the console. To log this to the console, you would have to write:


And then it would display


Also, this line of code will not run after a return statement. If you were to have it run first in your function, it would but the return statement still wouldn't log to the console. I would remove it.


thanks again!! :smiley:


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