function init(){
var panel = document.getElementById("panel");
var i;
var week = ["monday","tuesday","wednesday","thursday","friday"];
var weekend = ["saturday","sunday"];
panel.innerHTML+="weekdays: "+ week;
panel.innerHTML+="<hr>weekend days: "+ weekend;
for(i=0; i<weekend.length; i++)
{
week[week.length]=weekend[i];
}
panel.innerHTML+="<hr>increased with weekend days: "+week;
week-=2;
panel.innerHTML+="<hr>reduced back to weekdays: "+week;
}
window.onload=init;
this is the main js code it is loaded from another html file. everything is working fine until the end. the last output should be "reduced back to weekdays: monday,tuesday,wednesday,thursday,friday" but what im getting is this "reduced back to weekdays: NaN", what does this error mean and how can i fix it?