var d = new Date();
var weekday = new Array(7);
weekday[0] = "Sunday";
weekday[1] = "Monday";
weekday[2] = "Tuesday";
weekday[3] = "Wednesday";
weekday[4] = "Thursday";
weekday[5] = "Friday";
weekday[6] = "Saturday";
var n = weekday[d.getDay()];
document.write(n + getDate + getFullYear);
I'm having trouble displaying the current date. Any help would be helpful.
getDateandgetFullYearneed to be accessed through the Date instance,d, and they are functions so they need to be invoked with(), i.e.d.getDate(). Also, don't forget about Array literals['a', 'b', 'c'], they will save you a lot of typing.