Code returns [FUNCTION]


exercise 11

instead of printing 'Danny' it prints '[FUNCTION]'

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


I am going to change browsers to have a look Firefox to Chrome


The value you printed is a function, look at your code and verify that.
Makes sense that the output says "function" doesn't it?

Perhaps you meant to do something else, but only you can decide that.

Chrome and Firefox should both be fine.


This is why, you are not invoking the function. What you need to do is log the return value of the call expression:


With your


you are Displaying the associated-Value of the nameString variable which is a function....

To see the function-definition
you will have to use

console.log( nameString.toString() );