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 (中国标准时间)
上一篇:Web前端JQuery面试题(三)


下一篇:我与前端之间不得不说的三天两夜之html基础