function hello(){ console.log("hello!"); } var hello = function(){ console.log("hello!"); }
#函數自執行 var hello = function(num){ return 3 * num; }(5); #普通寫法 var hello = 5; hello = 3 * hello;
(function(){ console.log('Hello '); })();
function say(name){ var info = 'Hello ' + name; return function(){ console.log(info); } } var s= say('bret'); s();