Can't get the right value result with Maximum number of books borrowed ( don't get the highest value??)


Code JavaScript:
var booksArray = new Array (5);
var fivedaysArray = ['Monday','Tuesday','Wednesday','Thursday','Friday'];
var maxBooksIndex;
 
maxBooksIndex = 0;
 
document.write('Total number of library books borrowed in 5 days.');
for (var day = 0; day < fivedaysArray.length; day = day + 1)
{
    booksArray[day] = window.prompt('Please enter how many books borrowed on ' + (fivedaysArray[day]),'')
}; 
document.write('<BR>' + '<BR>');
document.write('Confirmation of students input' + '<BR>' + '<BR>');
 
for (var day = 0; day < fivedaysArray.length; day = day + 1)
{
    document.write(fivedaysArray[day] + ' : '
	+ booksArray[day] + '<BR>')
}
for (var day = 0; day < booksArray.length; day = day + 1) 
{
if (booksArray[day] > booksArray[maxBooksIndex]) 
{
maxBooksIndex = day
}
};
 
document.write('Maximum number of books borrowed was ' + booksArray[maxBooksIndex] + ' occurred in ' + fivedaysArray[maxBooksIndex])