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

来源:7-23 编程练习

慕妹6610264

2017-12-10 16:39

var mydate=new Date();

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

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


写回答 关注

4回答

  • weibo_笑着迈大步_0
    2017-12-13 15:43:22

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

  • qq_夜夜夜夜
    2017-12-10 19:19:38

    var today=new Date();

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

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

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


  • 梦里芊寻
    2017-12-10 19:15:10

    等号没加

  • 慕UI3735678
    2017-12-10 18:52:48

    var mydate=new Date();

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

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


JavaScript进阶篇

本课程从如何插入JS代码开始,带您进入网页动态交互世界

468190 学习 · 21891 问题

查看课程

相似问题