Node.js console.log not working -


simplest possible code in hello.js

(function() {     console.log("hello world!"); }); 

running : $node hello.js

there no output. if remove enclosing function, works properly. want use closure. ideas?

node version 0.10.30. ubuntu 12.04 x64

you,re not running function.

you should add function call:

(function() {   console.log("hello world!"); }).call(); 

or simply

(function() {   console.log("hello world!"); })(); 

Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -