node.js displays "undefined" on the console

The JavaScript functions always return something. If you don't specify something to return in the function, 'undefined' is returned by default (you can check this out in Firebug too).

Don't worry though, this doesn't affect anything, you can ignore it.


Just write "hello world"; and hit enter... it will return "hello world" instead of undefined, thus no undefined is displayed. console.log returns undefined and also logs arguments to console so you get multiple messages.