为了账号安全,请及时绑定邮箱和手机立即绑定

求大神帮忙,为什么没输出结果?

var mydate=new Date();

var weekday["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];

document.write(mydate.getFullYear()+"年"+mydate.getMonth()+1+"月"+mydate.getDate()+"日"+weekday[mydate.getDay()]);


正在回答

4 回答

weekday变量定义时候出错,少了等号。

0 回复 有任何疑惑可以回复我~

var today=new Date();

  var weekday=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];

  document.write(today.getFullYear()+"年"+today.getMonth()+"月"+today.getDate()+"日 "+weekday[today.getDay()]+"--班级总分为:");  

这是我写的,你mydate.getMonth()+1是什么意思呢


0 回复 有任何疑惑可以回复我~

等号没加

0 回复 有任何疑惑可以回复我~

var mydate=new Date();

var weekday=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];

document.write(mydate.getFullYear()+"年"+mydate.getMonth()+1+"月"+mydate.getDate()+"日"+weekday[mydate.getDay()+1]);


0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

求大神帮忙,为什么没输出结果?

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信