I initialize part of an array, but when I display them, they are incorrect or duplicated.

Here is my code:

But here is the displayed output:Code:

<html>

<head>

<title> Message display based on day and time </title>

<script>

function getdhh()

{

var prog = new Array(623);

// Fill array with 168 messages, one each hour of week,

prog[000] = "Sunday 00:00";

prog[001] = "Sunday 01:00";

prog[002] = "Sunday 02:00";

prog[003] = "Sunday 03:00";

prog[004] = "Sunday 04:00";

prog[005] = "Sunday 05:00";

prog[006] = "Sunday 06:00";

prog[007] = "Sunday 07:00";

prog[008] = "Sunday 08:00";

prog[009] = "Sunday 09:00";

prog[010] = "Sunday 10:00";

prog[011] = "Sunday 11:00";

prog[012] = "Sunday 12:00";

prog[013] = "Sunday 13:00";

prog[014] = "Sunday 14:00";

prog[015] = "Sunday 15:00";

prog[016] = "Sunday 16:00";

prog[017] = "Sunday 17:00";

prog[018] = "Sunday 18:00";

prog[019] = "Sunday 19:00";

prog[020] = "Sunday 20:00";

prog[021] = "Sunday 21:00";

prog[022] = "Sunday 22:00";

prog[023] = "Sunday 23:00";

prog[025] = "."

prog[101] = "Monday 01:00";

prog[111] = "Monday 11:00";

prog[122] = "Monday 22:00";

prog[202] = "Tues. 02:00";

prog[203] = "Tues. 03:00";

prog[209] = "Tues. 09:00";

prog[310] = "Wed. 10:00";

prog[320] = "Wed. 20:00";

prog[323] = "Wed. 23:00";

prog[400] = "Thursday 00:00";

prog[401] = "Thursday 01:00";

prog[411] = "Thursday 11:00";

prog[421] = "Thursday 21:00";

prog[500] = "Friday 00:00";

prog[512] = "Friday 12:00";

prog[600] = "Sat. 00:00";

prog[623] = "Sat. 23:00";

document.write("<br> prog(000) is ");

document.write(prog[000]);

document.write("<br> prog(001) is ");

document.write(prog[001]);

document.write("<br> prog(002) is ");

document.write(prog[002]);

document.write("<br> prog(003) is ");

document.write(prog[003]);

document.write("<br> prog(004) is ");

document.write(prog[004]);

document.write("<br> prog(005) is ");

document.write(prog[005]);

document.write("<br> prog(006) is ");

document.write(prog[006]);

document.write("<br> prog(007) is ");

document.write(prog[007]);

document.write("<br> prog(008) is ");

document.write(prog[008]);

document.write("<br> prog(009) is ");

document.write(prog[009]);

document.write("<br> prog(010) is ");

document.write(prog[010]);

document.write("<br> prog(011) is ");

document.write(prog[011]);

document.write("<br> prog(012) is ");

document.write(prog[012]);

document.write("<br> prog(013) is ");

document.write(prog[013]);

document.write("<br> prog(014) is ");

document.write(prog[014]);

document.write("<br> prog(015) is ");

document.write(prog[015]);

document.write("<br> prog(016) is ");

document.write(prog[016]);

document.write("<br> prog(017) is ");

document.write(prog[017]);

document.write("<br> prog(018) is ");

document.write(prog[018]);

document.write("<br> prog(019) is ");

document.write(prog[019]);

document.write("<br> prog(020) is ");

document.write(prog[020]);

document.write("<br> prog(021) is ");

document.write(prog[021]);

document.write("<br> prog(022) is ");

document.write(prog[022]);

document.write("<br> prog(023) is ");

document.write(prog[023]);

document.write("<br> prog(024) is ");

document.write(prog[024]);

document.write("<br> prog(025) is ");

document.write(prog[025]);

}

</script>

</head>

<body>

<script>

getdhh();

</script>

</body>

</html>

Notice how some of the values are duplicated. This is my first attempt at writing javascript, so I could be doing something wrong; but I don't know what.Code:

prog(000) is Sunday 00:00

prog(001) is Sunday 01:00

prog(002) is Sunday 02:00

prog(003) is Sunday 03:00

prog(004) is Sunday 04:00

prog(005) is Sunday 05:00

prog(006) is Sunday 06:00

prog(007) is Sunday 07:00

prog(008) is Sunday 10:00

prog(009) is Sunday 11:00

prog(010) is Sunday 10:00

prog(011) is Sunday 11:00

prog(012) is Sunday 12:00

prog(013) is Sunday 13:00

prog(014) is Sunday 14:00

prog(015) is Sunday 15:00

prog(016) is Sunday 16:00

prog(017) is Sunday 17:00

prog(018) is Sunday 22:00

prog(019) is Sunday 23:00

prog(020) is Sunday 20:00

prog(021) is Sunday 21:00

prog(022) is Sunday 22:00

prog(023) is Sunday 23:00

prog(024) is undefined

prog(025) is .