In days of yore, some browsers would pre-allocate some number of empty (undefined) array entries. In my opinion, it's pointless and in fact a bad habit even though that doesn't happen now. It's just a weird API and weird things are bug launchers.
Your code could be much prettier, for example:
var weekday = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
My reason for thinking that new Array(n) is a bad idea is that the setup of the Array constructor has two modes:
new Array(22);
means to create an Array instance with 22 null entries, but
new Array(22, 23, 24);
means to create an Array instance with 3 entries. It's confusing and weird, and really shouldn't have been done that way.