ImmediateFunc.js

(function(){
    var days = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat']
    var today = new Date()
    var msg = "Today is" + days[today.getDay()] + ',' + today.getDate()
    console.log(msg)
})();   // Today isThu,29


// 即时函数的参数
(function(who,when){
    console.log(' i met ' + who + ' on ' + when)
})("cynthai",new Date());  //i met cynthai on Thu Oct 29 2015 18:03:09 GMT+0800 (中国标准时间)

 

posted @ 2015-11-10 17:29  Cynthia娆墨旧染  阅读(166)  评论(0编辑  收藏  举报