Javascript函数有一些问题。这是我的代码:
function date(){
var d = new Date();
var day = d.getDay();
var month = d.getMonth() + 1;
var date = d.getDate();
var year = d.getFullYear();
var days = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
document.getElementById("footer").innerHTML = day[days] + " " + month + "/" + date + "/" + year;
}
此函数返回“undefined 3/5/2013”,但应该返回“Tuesday 3/5/2013”。我的逻辑有错误吗?谁能帮我找出我的错误?