问答详情
源自:7-23 编程练习

我这个日期输出有问题吗?怎么不出来

var mydate=new Date();

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

var mynum=mydate.getDay();


document.write(mydate.getFullYear()+"年"+mydate.getMonth()+"月"+mydate.getDate()+"日"+weekday(mynum));


提问者:qq_颖心晴_04387028 2017-02-28 22:09

个回答

  • 不知不觉后知后觉嗯
    2017-02-28 22:30:09
    已采纳


    document.write(mydate.getFullYear()+"年"+mydate.getMonth()+"月"+mydate.getDate()+"日"+weekday(mynum)); //weekday[mynum],要用中括号不是小括号


  • qq_颖心晴_04387028
    2017-03-02 19:44:55

    可以了,谢谢