Array changing by getDay() method
I'm having the hardest time creating this addition to my webpage. Basically all I want is create an array with 7 facts about my page, and then have my page display them one at a time depending on the day of the week.
If anyone could help me it would be greatly appreciated.
A now contains every thing but the day's choice, which was removed with the splice..
var q=new Date().getDay();
alert(A.splice(q))// or document.write, innerHTML, createTextNode...
Thank you for the help! Are there any alternatives to the splice method? I've never seen splice used in my class before.
Last edited by Dryst; 12-01-2009 at 04:00 PM.
You don't need to use splice at all. Just return A[new Date().getDay()],
and don't use that index again on the same page.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)