var days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
var birthDate = new Date(year, monthNumber/3, day);
var dayNumber = (birthDate.getDay());
var dayName = days.indexOf(dayNumber);
document.writeln ('I was born on a ' + dayName + '');{
为什么要赢得这项工作?它输出-1对我来说,var daynumber是正确的,显示正确的日期编号,但是如何让它对应/输出实际的日期名称?
答案 0 :(得分:0)
这将有效:
var dayName = days[dayNumber];