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

为什么没有输出

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

    var day1=new Date();

    document.write(

    day1.getFullYear() + "年" + (day1.getMonth()+1) + "月" + day1.getDate()+ "日" + " "+ weekday[day1.getDay()]

     );


提问者:鹤闲 2019-04-03 22:12

个回答

  • weixin_慕姐3144220
    2019-04-04 15:45:33

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

    最后的分号用成了中文的分号,要用英文的分号。写代码时要注意在半角状态下写,就是英文状态下。