封装星期,利用map数据结构
优点:遍历更快
var weekMap = new Map();
weekMap.set(0,"星期日");
weekMap.set(1,"星期一");
weekMap.set(2,"星期二");
weekMap.set(3,"星期三");
weekMap.set(4,"星期四");
weekMap.set(5,"星期五");
weekMap.set(6,"星期六");
function getWeek(w){
return weekMap.get(w);
}