获取星期几可以这样写吗,是什么意思,能解释一下吗?
1 回答
已采纳
慕瓜0345711
TA贡献1条经验 获得超0个赞
后面那段代码就相当于这样
var day = ["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
day[today.getDay()],today.getDay()是0-6的数字,这就相当于访问day数组;
如今天是星期日,today.getDay() ==0 ,day[0]就是星期日
添加回答
举报
0/150
提交
取消